List of new CPAN distributions – Oct 2018

dist author version abstract
API-DeutscheBahn-Fahrplan EDWARDF 0.01 Deutsche Bahn Fahrplan API Client
Acme-CPANModules-API-Dead-Currency PERLANCAR 0.001 Marking dead currency APIs
Acme-CPANModules-DesktopModules PERLANCAR 0.001 Modules related to GUI desktop environment
Acme-Test-MetaCPAN-NoContributingDoc ZAKAME 0.01 Test module for MetaCPAN /contributing-to
Alien-geos SLAFFAN 1.001 Alien package for GEOS – Geometry Engine, Open Source
App-BluetoothUtils PERLANCAR 0.001 CLI utilities related to Bluetooth
App-CpanfileSlipstop POKUTUNA 0.01 write installed module versions back to cpanfile
App-Gezer SHLOMIF 0.0.1 HTML Postprocessor and frontend to html-minifier
App-GitHubUtils PERLANCAR 0.001 Create github repo
App-HTTPTinyUtils PERLANCAR 0.001 Command-line utilities related to HTTP::Tiny
App-NYTProfUtils PERLANCAR 0.001 CLI utilities related to Devel::NYTProf
App-Perl6LangServer AZAWAWI v0.1.0
App-Search-BackPAN MANWAR 0.01 Command Line Interface for backpan.perl.org.
App-VersioningSchemeUtils PERLANCAR 0.001 Utilities related to Versioning::Scheme
App-github-cmd PERLANCAR 0.001 Yet another github CLI
Azure-AD-Auth JLMARTIN 0.01 Libraries for authenticating through Azure AD
B-COW ATOOMIC 0.001 B::COW additional B helpers to check COW status
Bencher-Mark PERLANCAR 0.001 Benchmark like Benchmark.pm
Bencher-Scenarios-HTTPTinyPatchRetry PERLANCAR 0.001 Benchmark HTTP::Tiny::Patch::Retry
Bencher-Scenarios-MonkeyPatchAction PERLANCAR 0.001 Benchmark Monkey::Patch::Action
Bencher-Scenarios-PackageMoreUtil PERLANCAR 0.001 Benchmark Package::MoreUtil
Bio-Cluster CJFIELDS 1.7.3 BioPerl cluster modules
Bluetooth-Any PERLANCAR 0.001 Common interface to bluetooth functions
Bundler-MultiGem KUPTA 0.01 bundle-multigem utility for gem versions benchmarking
CPAN-Audit VTI 0.01 Audit CPAN distributions for known vulnerabilities
Catalyst-Plugin-Statsd RRWO v0.1.1 log Catalyst stats to statsd
CatalystX-Statsd RRWO v0.1.0 log Catalyst stats to statsd
Catapulse-Module-Test DAB 0.01 A test module for Catapulse
Catmandu-File VPEIL 0.01 only execute fixes if the directory exists
Catmandu-I18N NJFRANCK 0.01 tools for text localisation
DBIx-Class-InflateColumn-Geo CSSON 0.0100 Inflate geometric columns to data structures
DBIx-LogProfile BJOERN 0.01 Log DBI::Profile data into Log::Any or Log4perl
DBIx-OnlineDDL GSG 0.90 Run DDL on online databases safely
Dancer2-Logger-Log4perl CROMEDOME 0.04 Dancer2 logger interface for Log4perl.
Dancer2-Session-CHI CROMEDOME 0.01 Dancer 2 session storage with CHI backend
Data-Edit-Xml-To-Dita PRBRENAN 2018 Convert multiple Xml documents in parallel to Dita.
Data-Edit-Xml-Xref PRBRENAN 2011006 Cross reference data held in the XML format.
Digest-SRI HAUKEX 0.02 Calculate and verify Subresource Integrity hashes (SRI)
Dist-Zilla-Plugin-Generate-ManifestSkip RRWO v0.1.0 generate a MANIFEST.SKIP file for your distribution
Dist-Zilla-Plugin-Qgoda GUIDO 0.1.0 Write a package.json for Qgoda plug-ins.
File-LoadLines JV 0.01 Load lines from file
Finance-CoinbasePro-API-CLI JOSHR 0.000_01 Command-line interface to GDAX / Coinbase Pro
Game-Collisions TMURRAY 0.1 Fast, pure Perl collision 2D detection
Grammar-Convert-ABNF-Pegex RENEEB 0.01 convert an ABNF grammar to Pegex
Graphics-ColorNames-HTML RRWO v3.3.0 HTML color names and equivalent RGB values
Graphics-ColorNames-Windows RRWO v3.3.0 Windows color names and equivalent RGB values
HTML-FormHandlerX-Widget-Field-Template RRWO v0.1.0 render fields using templates
HTTP-Tiny-Cache PERLANCAR 0.001 Cache HTTP::Tiny responses
HTTP-Tiny-Patch-Retry PERLANCAR 0.001 Retry failed HTTP::Tiny requests
JSON-Patch MIXAS 0.01 JSON Patch (rfc6902) for
JSON-Transform ETJ 0.01 arbitrary transformation of JSON-able data
Kafka-Producer-Avro ALVAROL 0.01 Avro message producer for Apache Kafka.
Mail-Pyzor CPANEL 0.01 Pyzor spam filtering in Perl
Mail-STS BENNING 0.01 library for looking up MTA-STS policies
Math-FFT-Libfftw3 FRITH v0.0.1
Meetup-API CORION 0.01 interface to the Meetup API
Mojo-Promise-Role-Get DBOOK v0.1.0 Wait for the results of a Mojo::Promise
Mojolicious-Command-Author-generate-resources BEROV 0.22 Generate MVC & OpenAPI RESTful API files from database tables
Mojolicious-Plugin-FastHelpers JHTHORSEN 0.01 Faster helpers for your Mojolicious application
Mojolicious-Plugin-SpectreCss EJUNGLE 0.01 Mojolicious Plugin
Monitoring-Icinga2-Client-Simple MBETHKE 0.001000 Simpler REST client for Icinga2
MooX-Role-Parameterized-With-Keyword PERLANCAR 0.001 DSL to apply roles with composition parameters
Music-BachChoralHarmony GENE 0.0100 Parse the UCI Bach choral harmony data set
Net-Async-Consul ROBN 0.001 Make async calls to Consul via IO::Async
Net-Clacks CAVAC 4.6 Fast client/server interprocess messaging and memcached replacement
Net-Google-Drive VRAG 0.01 simple Google drive API module
Net-Google-OAuth VRAG 0.01 Simple Google oauth api module
Net-Prometheus-PerlCollector PEVANS 0.01 obtain statistics about the perl interpreter
No TROHAU 1.09 Norwegian dates
OData-QueryParams-DBIC RENEEB 0.01 parse OData style query params and provide info for DBIC queries.
Overload-FileCheck ATOOMIC 0.001 override/mock perl file checks ops
Path-ExpandTilde DBOOK 0.001 Expand tilde (~) to homedir in file paths
Pcore-Resources ZDM v0.1.0
Perl5-Build-Warnings JKEENAN 0.01 Parse make output for build-time warnings
PiFlash IKLUFT 0.0.2 command-line processing for piflash script to flash SD card for Raspberry Pi
Serge-Sync-Plugin-TranslationService-Smartcat TARAS 0.0.1 Smartcat translation server .po synchronization plugin.
Serge-Sync-Plugin-TranslationService-lingohub DRAGOSV 0.900.0 Lingohub translation server (https://www.lingohub.com) synchronization plugin
Smartcat-App TARAS 0.0.1 Smartcat cli application
Smartcat-Client TARAS 0.0.1 a Moose role for the Smartcat Integration API
Software-Catalog-SW-dummy-undownloadable PERLANCAR 0.001 A dummy software that is undownloadable
String-Interpolate-Named JV 0.02 Interpolated named arguments in string
Sub-Fp ODDTUPLE 0.01 The great new Sub::Fp!
Test-MockFile TODDR 0.001 Lets tests validate code which interacts with files without the file system ever being touched.
Test2-Tools-PDL SLOYD 0.0001 Test2 tools for verifying Perl Data Language piddles
Text-ANSITable-SQLStyleSheet BJOERN 0.01 Pretty tables with SQL-generated styles
Text-Substitute JV 0.01 Substitute in text
Tie-Hash-RedisDB INSPIRE 1.00 A very thin Tie around a RedisDB Hash
Tie-Subset HAUKEX 0.01 Tie an array or hash to a subset of another array or hash, respectively
Versioning-Scheme PERLANCAR 0.001 Deal with various versioning schemes
WWW-Google-Login CORION 0.01 log a mechanize object into Google
WebService-Google-Client STEVIED 0.03 Server-side client library for any Google App API. Based on Moose
WebService-GoogleAPI-Client LOCALSHOP 0.10 Google API Services Client.
WebService-HMRC NPRATER 0.01 Interact with the UK HMRC Making Tax Digital API
WebService-HMRC-CreateTestUser NPRATER 0.01 Interact with the UK HMRC CreateTestUser API
WebService-HMRC-HelloWorld NPRATER 0.01 Interact with the UK HMRC HelloWorld API
WebService-HMRC-VAT NPRATER 0.01 Interact with the UK HMRC VAT API
WebService-Mattermost MIKEJONES 0.001 a SDK for interacting with Mattermost.
Advertisements

Matching several things (in no particular order) using a single regex

Matching several things using a regex is pretty straightforward:

/(foo).*(bar).*(baz)/

This also implies the order of the things. If you want to require that foo, bar, baz all exist but in no particular order, you can use lookahead and lookbehind (explained in great detail in this wonderful regex tutorial article):

/(?=.*foo)(?=.*bar)(?=.*baz)/

If you also want to capture the things:

/(?=.*(foo))(?=.*(bar))(?=.*(baz))/
/(?=.*(?<one>foo))(?=.*(?<two>bar))(?=.*(?<three>baz))/

Let's see how that works:

for ("foo bar baz", "foo baz bar", "baz bar foo", "foo bar") {
    if (/(?=.*(foo))(?=.*(bar))(?=.*(baz))/) {
        say "'$_' matches the regex, \$1=<$1>, \$2=<$2>, \$3=<$3>";
    } else {
        say "'$_' does not match the regex";
    }
}

We'll get:

'foo bar baz' matches the regex, $1=<foo>, $2=<bar>, $3=<baz>
'foo baz bar' matches the regex, $1=<foo>, $2=<bar>, $3=<baz>
'baz bar foo' matches the regex, $1=<foo>, $2=<bar>, $3=<baz>
'foo bar' does not match the regex

Note that, obviously, the order of the captures follows the order it is defined in our pattern and not the order in the string that is being matched.

As a bonus, in this case the unordered version is faster than the ordered version because of reduced backtracking:

% perl -Ilib -MBencher::Mark=:all -E'$str = "foo bar baz";
  cmpthese(0, {
    ordered   => sub { $str =~ qr/(foo).*(bar).*(baz)/ },
    unordered => sub { $str => qr/(?=.*(foo))(?=.*(bar))(?=.*(baz))/ },
  });'
+-------------+-----------+-----------+------------+---------+---------+
| participant | rate (/s) | time (ns) | vs_slowest |  errors | samples |
+-------------+-----------+-----------+------------+---------+---------+
| ordered     |    860000 |      1200 |        1   | 1.7e-09 |      20 |
| unordered   |   2700000 |       370 |        3.2 |   1e-09 |      21 |
+-------------+-----------+-----------+------------+---------+---------+

And it becomes even relatively faster the longer the string:

% perl -Ilib -MBencher::Mark=:all -E'$str = "foo".(" "x10000)."bar".(" "x10000)."baz";
  cmpthese(0, {
    ordered   => sub { $str =~ qr/(foo).*(bar).*(baz)/ },
    unordered => sub { $str => qr/(?=.*(foo))(?=.*(bar))(?=.*(baz))/ },
  });'
+-------------+-----------+-----------+------------+---------+---------+
| participant | rate (/s) | time (ns) | vs_slowest |  errors | samples |
+-------------+-----------+-----------+------------+---------+---------+
| ordered     |     20000 |    51     |          1 | 1.1e-07 |      20 |
| unordered   |   2540000 |     0.394 |        130 | 2.3e-10 |      20 |
+-------------+-----------+-----------+------------+---------+---------+

But of course remember that separating the check into multiple simpler patterns can be even faster.

List of new CPAN distributions – Sep 2018

dist author version abstract
Acme-CPANModules-CLI-Wrapper-UnixCommand PERLANCAR 0.001 Various CLIs that wrap (popular) Unix commands
Acme-CPANModules-PERLANCAR-Temp-Plus PERLANCAR 0.001 Modules I plus while MetaCPAN's ++ is not working
Acme-CPANModulesBundle-Import PERLANCAR 0.001 Collection of module lists with source imported from web pages
Acme-CPANModulesBundle-Import-BKB PERLANCAR 0.001 CPANLists imported from Ben Bullock's website
Acme-CPANModulesBundle-Import-NEILB PERLANCAR 0.001 CPANLists imported from http://neilb.org/reviews/
Acme-CPANModulesBundle-Import-PERLANCAR-Advent-2014 PERLANCAR 0.001 Modules mentioned in PERLANCAR's 2014 advent calendar article series
Acme-CPANModulesBundle-Import-PERLANCAR-GetoptModules PERLANCAR 0.001 Modules mentioned in PERLANCAR's mini-article series on Getopt modules (2016)
Acme-CPANModulesBundle-Import-PerlAdvent-2000 PERLANCAR 0.001 Modules mentioned in Perl Advent Calendar 2000
Acme-CPANModulesBundle-Import-PerlAdvent-2001 PERLANCAR 0.001 Modules mentioned in Perl Advent Calendar 2001
Acme-CPANModulesBundle-Import-PerlAdvent-2002 PERLANCAR 0.001 Modules mentioned in Perl Advent Calendar 2002
Acme-CPANModulesBundle-Import-PerlAdvent-2003 PERLANCAR 0.001 Modules mentioned in Perl Advent Calendar 2003
Acme-CPANModulesBundle-Import-PerlAdvent-2004 PERLANCAR 0.001 Modules mentioned in Perl Advent Calendar 2004
Acme-CPANModulesBundle-Import-PerlAdvent-2005 PERLANCAR 0.001 Modules mentioned in Perl Advent Calendar 2005
Acme-CPANModulesBundle-Import-PerlAdvent-2006 PERLANCAR 0.001 Modules mentioned in Perl Advent Calendar 2006
Acme-CPANModulesBundle-Import-PerlAdvent-2007 PERLANCAR 0.001 Modules mentioned in Perl Advent Calendar 2007
Acme-CPANModulesBundle-Import-PerlAdvent-2008 PERLANCAR 0.001 Modules mentioned in Perl Advent Calendar 2008
Acme-CPANModulesBundle-Import-PerlAdvent-2009 PERLANCAR 0.001 Modules mentioned in Perl Advent Calendar 2009
Acme-CPANModulesBundle-Import-PerlAdvent-2010 PERLANCAR 0.001 Modules mentioned in Perl Advent Calendar 2010
Acme-CPANModulesBundle-Import-PerlAdvent-2011 PERLANCAR 0.001 Modules mentioned in Perl Advent Calendar 2011
Acme-CPANModulesBundle-Import-PerlAdvent-2012 PERLANCAR 0.001 Modules mentioned in Perl Advent Calendar 2012
Acme-CPANModulesBundle-Import-PerlAdvent-2013 PERLANCAR 0.001 Modules mentioned in Perl Advent Calendar 2013
Acme-CPANModulesBundle-Import-PerlAdvent-2014 PERLANCAR 0.001 Modules mentioned in Perl Advent Calendar 2014
Acme-CPANModulesBundle-Import-PerlAdvent-2015 PERLANCAR 0.001 Modules mentioned in Perl Advent Calendar 2015
Acme-CPANModulesBundle-Import-PerlAdvent-2016 PERLANCAR 0.001 Modules mentioned in Perl Advent Calendar 2016
Acme-CPANModulesBundle-Import-PerlDancerAdvent-2010 PERLANCAR 0.001 Modules mentioned in PerlDancer Advent Calendar 2010
Acme-CPANModulesBundle-Import-PerlDancerAdvent-2011 PERLANCAR 0.001 Modules mentioned in PerlDancer Advent Calendar 2011
Acme-CPANModulesBundle-Import-PerlDancerAdvent-2012 PERLANCAR 0.001 Modules mentioned in PerlDancer Advent Calendar 2012
Acme-CPANModulesBundle-Import-PerlDancerAdvent-2014 PERLANCAR 0.001 Modules mentioned in PerlDancer Advent Calendar 2014
Acme-CPANModulesBundle-Import-PerlDancerAdvent-2016 PERLANCAR 0.001 Modules mentioned in PerlDancer Advent Calendar 2016
Acme-CPANModulesBundle-Import-PerlTricks PERLANCAR 0.001 Modules mentioned in PerlTricks.com articles
Acme-CPANModulesBundle-Import-RSAVAGE PERLANCAR 0.001 CPANLists imported from Ron Savage's blog posts
Acme-CPANModulesBundle-Import-SHARYANTO PERLANCAR 0.001 CPANLists imported from Steven Haryanto's blog posts
Acme-CPANModulesBundle-PERLANCAR-Self PERLANCAR 0.001 Categorizing my own modules
Acme-covfefe CAVAC 42 Simulate POTUS tweets
Alien-BCM2835 STRO 1.056 Alien installation of bcm2835 library
Alien-libuuid PLICEASE 0.01 Find or download and install libuuid
App-AsciiChart VTI 0.01 Simple Ascii Chart
App-CPANModulesUtils PERLANCAR 0.001 Command-line utilities related to Acme::CPANModules
App-Cleo-Patra BORISD 0.001 Play back shell commands for live demonstrations
App-Deps-Verify SHLOMIF 0.0.1 An app and API to verify the presence of dependencies (Perl 5 modules, python3 modules, executables, etc.
App-Git-IssueManager BYTERAZOR 0.1 subcommand to git for issue management
App-Git-IssueManager-SyncJira BYTERAZOR 0.1 class implementing the sync_jira issue command of the GIT IssueManager
App-GraphicsColorNamesUtils PERLANCAR 0.001 Utilities related to Graphics::ColorNames
App-IDXUtils PERLANCAR 0.001 Command-line utilities related to Indonesian Stock Exchange
App-JsonLogUtils JEFFOBER 0.01 Command line utilities for dealing with JSON-formatted log files
App-StockExchangeUtils PERLANCAR 0.001 Command-line utilities related to stock exchanges
App-XTermUtils PERLANCAR 0.001 Utilities related to XTerm
App-colorxform PERLANCAR 0.001 Transform colors on the CLI
App-finquote PERLANCAR 0.001 Get stock and mutual fund quotes from various exchanges
App-finquotehist PERLANCAR 0.001 Fetch historical stock quotes
App-instopt PERLANCAR 0.000 Download and install software
App-japerl INA 0.10 JPerl-again Perl glocalization scripting environment
App-lcpan-CmdBundle-backpan PERLANCAR 0.001 More lcpan subcommands related to BackPAN
App-lcpan-CmdBundle-cpantesters PERLANCAR 0.001 More lcpan subcommands related to CPAN Testers
App-nrand PERLANCAR 0.001 Generate normally distributed random numbers
App-sshwrap-hostcolor PERLANCAR 0.001 SSH wrapper script to remember the terminal background you use for each host
App-swcat PERLANCAR 0.001 Software catalog
App-vl BAYASHI 0.01 Makes CUI table vertical
AppLib-sshwrap PERLANCAR 0.001 Common routines/data for sshwrap-* scripts
Astro-Coord-ECI-VSOP87D WYANT 0.000_01 Implement the VSOP87D position model.
Bencher-Scenario-ColorRGBUtil PERLANCAR 0.001 Benchmark Color::RGB::Util
Bencher-Scenario-NormalRandom PERLANCAR 0.001 Benchmark generating normally distributed normal numbers
Bencher-Scenarios-StringFunctions PERLANCAR 0.001 Benchmark string functions
Bijection LNATION 0.01 Bijection of an integer.
Bio-Align-Graphics CJFIELDS 1.7.3 Graphic Rendering of Bio::Align::AlignI Objects
Bio-AlignIO-stockholm CJFIELDS 1.7.3 stockholm sequence input/output stream
Bio-DB-Ace CJFIELDS 1.7.3 Database object interface to ACeDB servers
Bio-DB-TFBS CJFIELDS 1.7.3 Access to a Transcription Factor Binding Site database
Bio-Draw-Pictogram CJFIELDS 1.7.3 generate SVG output of Pictogram display for consensus motifs
Bio-NeXMLIO CJFIELDS 1.7.3 stream handler for NeXML documents
Bio-PhyloNetwork CJFIELDS 1.7.3 Module to compute with Phylogenetic Networks
Bio-PopGen CJFIELDS 1.7.3 Input individual,marker,allele information
Bio-SearchIO-hmmer CJFIELDS 1.7.3 A parser for HMMER2 and HMMER3 output (hmmscan, hmmsearch, hmmpfam)
Bio-SeqIO-excel CJFIELDS 1.7.3 sequence input/output stream from a MSExcel-formatted table
Bio-Tools-Gel CJFIELDS 1.7.3 Calculates relative electrophoretic migration distances
Bio-Tools-Run-RemoteBlast CJFIELDS 1.7.3 Object for remote execution of the NCBI Blast via HTTP
Bio-Tree-Draw-Cladogram CJFIELDS 1.7.3 Drawing phylogenetic trees in Encapsulated PostScript (EPS) format.
Bio-TreeIO-svggraph CJFIELDS 1.7.3 A simple output format that converts a Tree object to an SVG output
Bit-Twiddling BRIANG 0.06 Low-level bit-twiddling hacks
Catalyst-Plugin-Shorten LNATION 0.01 The great ancient URI shortner!
Catmandu-ALTOXML NJFRANCK 0.01 tools to work with ALTOXML documents
Catmandu-HOCR NJFRANCK 0.01 tools to work with HOCR documents
Confluent-SchemaRegistry ALVAROL 0.01 A simple client for interacting with Confluent Schema Registry.
Data-Exchange PRBRENAN 20180916 Exchange files and update issues from your colleagues via an S3 bucket.
Dist-Zilla-Plugin-Test-NoBOM GGOLDBACH 0.001 Make sure files do not start with BOM
Dist-Zilla-Plugin-WriteVersion KIVILAHTI 0.001 Write the version to all Perl files and scripts
Dist-Zilla-PluginBundle-Starter-Git DBOOK v3.0.0 A minimal Dist::Zilla plugin bundle for git workflows
Dpkg GUILLEM v1.19.1 Debian Package Manager Perl modules
Email-Address-UseXS TEAM 1.000 ensure that any code uses Email::Address::XS instead of Email::Address
Exporter-Extensible NERDVANA 0.01 Create extensible modules which export things
File-Slurper-Shortcuts PERLANCAR 0.001 Some convenience additions for File::Slurper
Finance-SE-Catalog PERLANCAR 20180919 Catalog (list) of stock exchanges
Finance-SE-IDX PERLANCAR 0.001 Get information from Indonesian Stock Exchange
Finance-SE-IDX-Any PERLANCAR 0.001 Get information from Indonesian Stock Exchange
Finance-SE-IDX-Static PERLANCAR 20180907.0.0 List firms listed on the IDX
Genealogy-ChroniclingAmerica NHORNE 0.01 Find URLs for a given person on the Library of Congress Newspaper Records
Git-IssueManager BYTERAZOR 0.1 Module for managing issues in a git branch within your repository
Graphics-ColorNames-Netscape RRWO v3.1.0 Netscape 1.1 Color Names
Graphics-ColorNames-Werner RRWO v1.0.0 RGB codes for Werner's Nomensclature of Colours
HTML-T5 SHLOMIF 0.001 HTML validation in a Perl object
Hetula-Client KIVILAHTI 0.001 Interface with Hetula
IMDB-JSON CFABER 0.01
JSON-API-Error KWAKWA 0.01 JSON API-style error objects
Jojo-Compat FERREIRA 0.1.0 Jojo::Base and Jojo::Role for pure Perl environments
Log-Any-Adapter-Apache2 IVANYCH 0.01 Log::Any adapter for Apache2::Log
Mail-AuthenticationResults-SpamAssassin MBRADSHAW 1.20180927 SpamAssassin plugin for parsing Authentication-Results headers via Mail::AuthenticationResults
Math-Random-PCG32 JMATES 0.01 minimal PCG random number generator
MikroTik-Client ANPARKER 0.30 Non-blocking MikroTik API client
Mojo-Promise-Role-HigherOrder BDFOY 1.001 Fulfill with the first fulfilled promise
Mojo-UserAgent-Role-Cache JHTHORSEN 0.01 Role for Mojo::UserAgent that provides caching
Mojolicious-Plugin-ForwardedFor DBOOK 0.001 Retrieve the remote address from X-Forwarded-For
Mojolicious-Plugin-PNGCast CORION 0.22 in-process server to display a screencast
Mojolicious-Plugin-Web-Auth-Site-Strava OALDERS 0.000001 Strava OAuth Plugin for Mojolicious::Plugin::Web::Auth
Net-Curl-Parallel RKINYON 2.0.0 perform concurrent HTTP requests using libcurl
Net-OneSky ERIKOGAN 0.0.1 Simple interface to the OneSky API: http://developer.oneskyapp.com/
Ordeal-Model POLETTIX 0.001 Manage cards and decks
OrePAN2-Indexer-Tiny AKIYM 0.01 Minimal DarkPAN indexer
Parser-GraphQL-XS GONZUS 0.000002 Perl XS binding for the libgraphsql GraphSQL parsing library
Perinci-Sub-Gen-AccessTable-Simple PERLANCAR 0.001 Generate function (and its metadata) to read table data
Perinci-Sub-XCompletionBundle-Color PERLANCAR 0.001 Completion routines related to color schemas
Perl-Critic-Policy-Modules-ProhibitUseLib GGOLDBACH 0.001 Prohibit 'use lib' in modules
Perl6-Build SKAJI 0.001 build rakudo Perl6
Protocol-DBus FELIPE 0.01-TRIAL1 D-Bus in pure Perl
SMS-Send-UK-BTSmartMessaging ANDREWISH v0.0.1
SQL-Translator-Parser-OpenAPI ETJ 0.01 convert OpenAPI schema to SQL::Translator schema
Sah-Schemas-Software PERLANCAR 0.001 Schemas related to software
Serge-Sync-Plugin-TranslationService-transifex DRAGOSV 0.900.0 Transifex translation server (https://www.transifex.com) synchronization plugin
Signer-AWSv4 JLMARTIN 0.01 Implements the AWS v4 signature algorithm
Software-Catalog-SW-bulwark-qt PERLANCAR 0.001 Bulwark desktop GUI client
Software-Catalog-SW-firefox PERLANCAR 0.001 Firefox
Software-Catalog-SW-zcoin-qt PERLANCAR 0.001 Zcoin desktop GUI client
Software-Catalog-SW-zotero PERLANCAR 0.001 Zcoin desktop GUI client
StackTrace-Pretty EGAWATA v0.0.1 Modules for stacktrace-pretty
Test-BOM GGOLDBACH 0.001 Test strings and files for byte order mark (BOM).
Test-Regexp-Pattern PERLANCAR 0.001 Test Regexp::Pattern patterns
Text-CSV-Piecemeal RNEWSHAM v0.0001 Piecemeal wrapper around Text::CSV for constructing csv files
Text-SRT-Align TIEDEMANN 0.2 Convert and align translated movie subtitles
Text-Table-XLSX PERLANCAR 0.001 Generate XLSX worksheet
Types-PGPLOT DJERIUS 0.01 Type::Tiny compatible types for the PGPLOT library
WebService-MIAB MINATI 0.01
XML-Invisible ETJ 0.01 transform "invisible XML" documents into XML using a grammar
XTerm-Util PERLANCAR 0.001 Utility routines for xterm-compatible terminal (emulator)s
YAML-LibYAML-API TINITA 0.001 Wrapper around the C libyaml library
YAML-PP-LibYAML TINITA 0.001 Faster backend for YAML::PP
packdrake TVIGNAUD 7.04 Generates hdlist and synthesis files + compatibility wrapper around the new MDV::Packdrakeng
rpmtools TVIGNAUD 7.01 Simple Archive Extractor/Builder
sayhi STEVIED 0.001 Add the module abstract here

Remembering terminal background color for each remote host we SSH to

Entering (the right) command to a wrong SSH session is no fun. To help me be aware that I am typing commands to a (the correct) remote host, I usually set the background color of my Konsole tab (manually, by right-clicking and then switching the profile). Inspired by this post, I decided to make my own SSH wrapper in Perl: sshwrap-hostcolor.

The wrapper

The sshwrap-hostcolor script is a wrapper that will execute ssh with the arguments you passed to it, but do some stuff before and after that. To try out this wrapper, first install it from CPAN:

% cpanm -n App::sshwrap::hostcolor

then alias it to ssh:

% alias ssh=sshwrap-hostcolor

(You might want to put the above line to your shell's startup file, if you decide to use this script permanently after all.)

Now ssh somewhere:

% ssh user@one.example.com

then change the terminal background color. After you exit, the wrapper will restore the original background color. But if you ssh to the same user+host again later, the background color that you set (and saved by the script to ~/.sshwrap-hostcolor.history) will be restored. See video demonstration.

If you want the wrapper to automatically assign a random color to a new user+host, you can set the environment variable SSHWRAP_HOSTCOLOR_AUTO to random-dark (or random-light, if you use a light background color), e.g.:

% export SSHWRAP_HOSTCOLOR_AUTO=random-dark

See video demonstration.

The completion script

The wrapper comes with its own tab completion script, which you can install using:

% complete -C _sshwrap-hostcolor ssh

This completion script can complete user+host argument for you, and when there's a single completion with known background color, the completion script will immediately change the terminal background color during completion. See video demonstration. This might or might not be to your liking, but you have the option to install the completion if you want this behavior.

Additional stuff

Note that this wrapper will only work with an XTerm-compatible terminal emulation software. See the list here.

While writing the wrapper script, I also wrote a few other CLI utilities.

get-term-bgcolor to programmatically get the terminal's current background color.

set-term-bgcolor to programmatically set the terminal's current background color. This script recognizes RGB color code (e.g. 00002b) or color names (e.g. black, darkblue).

show-color-swatch to show the list of color names and their codes. Use it as such:

% show-color-swatch X | less -R

Oh, and the set-term-bgcolor script also features tab completion (activated via complete -C set-term-bgcolor set-term-bgcolor) so you can complete color names, e.g.:

% set-term-bgcolor dark<Tab><Tab>

Should I choose x.yy or x.yyy versioning scheme for my Perl module?

Short answer

x.yyy.

Longer answer

Both schemes are simple and short. x.yy is shorter by a single digit, but it is prone to a trap. One day, when you want to update your 0.13 module with a minor change you might say to yourself, "Gee, it's such a minor change that I think I'll release it as 0.13.1 instead of 0.14. Semantic versioning and all that." So you did, and boom. PAUSE would accept it but would refuse to index it. Why?? You would scratch your head for a while. Turns out that according to version.pm, 0.13 > 0.13.1. Why??? Because 0.13 numifies into 0.130 and 0.13.1 numifies into 0.013001.

I've fell for it once (twice actually, before deciding to convert to x.yyy). It's amazing how many veteran CPAN authors fell for it. For example, here's Dave Cross in 2016. Others I've seen while browsing the MetaCPAN Recent page. My bad memory prevents me from remembering who and when, and I'm too lazy to check, but trust me it's embarassingly often.

You might argue it's a bug with version.pm or PAUSE or Perl for behaving unlike the rest of the world, but that's how versioning works in Perl so just avoid this trap and be done with this. You might also say, "I'll always increase the minor version and will never use x.yyy.zzz." But there's always the possibility thay you'll forget and do just that.

It's unfortunate that x.yy remains (by my guess) the most popular versioning scheme for Perl modules, but consider yourself warned.

More about versioning in Perl

Books can be written on and years can be spent debating about versioning and its best practices, including in Perl. If you want to read more, here are a few links to get you started:

Some related posts by yours truly:

List of new CPAN distributions – Aug 2018

dist author version abstract
Acme-FIREXFLY-Utils FIREXFLY 0.01 Chapter 21 exercise from the book ‘Intermediate Perl’
Acme-NAHCNUJ-Utils NAHCNUJ 0.01 Answer for exercise 21.3 of the book “Intermediate Perl”
Algorithm-Heapify-XS YVES 0.01 Perl extension for supplying simple heap primitives for arrays.
Alien-nragent PLICEASE 0.01 Download and install the NewRelic agent
Anki-Import STEVIED 0.006 Anki note generation made easy.
AnyEvent-WebDriver MLEHMANN 0.0 control browsers using the W3C WebDriver protocol
App-Git-Info SHLOMIF 0.0.1 displays a summary of information about the git repository.
App-ISBNUtils PERLANCAR 0.001 Command-line utilities related to ISBN
App-WHOGrowthReferenceUtils PERLANCAR 0.001 Utilities related to WHO growth reference
App-Weather BRADHEFF 0.01 a module that fetches the weather
App-YouTubeUtils PERLANCAR 0.001 Command-line utilities related to YouTube
App-ccdiff HMBRAND 0.20 Colored Character Diff
App-isbn PERLANCAR 0.001 Query book information by ISBN
App-ygeo PAVELSR 0.01 Extract companies data from Yandex Maps to csv file
Assert-Refute-T-Deep KHEDIN 0.01 Test::Deep plugin for Assert::Refute
Bencher-Scenarios-DataComparisonModules PERLANCAR 0.001 A collection of bencher scenarios to benchmark data structure comparison modules
Bencher-Scenarios-ISBN PERLANCAR 0.001 Benchmark ISBN modules
Boost-UUID ADDICT 0.01 perl interface for boost::uuid
CSV-Processor PAVELSR 1.00 Set of different methods that adds new columns in csv files
CtrlO-PDF ABEVERLEY 0.01 high level PDF creator
DAPNET-API RUNE 0.1 Use the DAPNET API from Perl
DBD-SQLeet DDMITOV 1.58 SQLite3 DBI Driver with optional encryption
DBIx-Connector-Retry GSG 0.90 DBIx::Connector with block retry support
Dancer2-Template-Alloy CVLIBRARY 0.001 Template::Alloy engine for Dancer2
Data-Cmp PERLANCAR 0.001 Compare two data structures, return -1/0/1 like cmp
DateTime-Calendar-TauStation CFRANKS 0.1.1 Handle TauStation GCT datetimes
DateTime-TauStation CFRANKS 0.1 Handle TauStation GCT datetimes
Dist-Zilla-Plugin-Babble LEONT 0.001 EXPERIMENTAL Automatic Babble substitution in Dist::Zilla
Dist-Zilla-Plugin-FFI PLICEASE 0.01 FFI related Dist::Zilla plugins
Dist-Zilla-Plugin-PodKnit YANICK 0.0.1 craft from warm and fuzzy documentation for your Perl code
Dist-Zilla-PluginBundle-QBit MADSKILL 0.8 Dist::Zilla bundle for build and release QBit Framework packages
ELF-sign PRIVI 0.03 X509 signing of elf execuables
FFI-Build PLICEASE 0.02 Build shared libraries for use with FFI::Platypus
File-Generator LSKATZ 0.2
File-Print-Many NHORNE 0.01 Print to more than one file descriptor at once
Function-Return KFLY 0.01 add return type for a function
GCloud-CLIWrapper JLMARTIN 0.01 Module to use Google Cloud APIs via the gcloud CLI
Game-DijkstraMap JMATES 0.01 a numeric grid of weights plus some related functions
Geo-Code ERUCI 1.1 Perl module for converting latitude,longitude to a single ten byte geocode string or three geonames, and vice versa.
HTML-FormFu-TauStation CFRANKS 1.182320 HTML::FormFu modules for working with GCT (Galactic Time Coordinated) datetimes and durations from the online game Tau Station
Image-Synchronize LSTROUS 1.0 a module for synchronizing filesystem modification timestamps of images, movies, and related files.
Keyword-Pluggable KARASIK 1.00 define new keywords in pure Perl
Lexical-TypeTiny TOBYINK 0.001 my Int $n
List-Unique-DeterministicOrder SLAFFAN 0.001 Store and access a list of keys using a deterministic order based on the sequence of insertions and deletions
MIME-Signature FANY 0.1 appends signature to mail messages
MooX-Should RRWO v0.1.0 optional type restrictions for Moo attributes
Net-Doveadm FELIPE 0.01 Dovecot’s administrative interface protocol
NewRelic-Agent-FFI PLICEASE 0.01 Perl Agent for NewRelic APM
Parallel-ForkManager-Segmented SHLOMIF 0.0.1 use Parallel::ForkManager on batches / segments of items.
Perl-Critic-Policy-ValuesAndExpressions-ProhibitEmptyPostfixLoop XSAWYERX 0.001 Prohibit writing an postfix loop with no statement
PerlX-Define TOBYINK 0.100 cute syntax for defining constants
Pod-Knit YANICK 0.0.1 Stitches together POD documentation
Pod-Readme-Brief ARISTOTLE 1.000 A short simple README with just the essentials
Pod-Weaver-PluginBundle-SHLOMIF SHLOMIF 0.001000 SHLOMIF’s default Pod::Weaver config
Pod-Weaver-PluginBundle-SLOYD SLOYD 0.0001 SLOYD’s default Pod::Weaver configuration
Repetition-Interval MALLEN 0.001 A library to calculate intervals for spaced repetition memorization
Sah-Schemas-EAN PERLANCAR 0.001 Various Sah schemas related to EAN (International/European Article Number)
Sah-Schemas-ISBN PERLANCAR 0.001 Various Sah schemas related to ISBN (International Standard Book Number)
School-Evaluation-Gibbmers BORISD 0.001 render a chart
Serge-Sync-Plugin-TranslationService-crowdin DRAGOSV 0.900.0 Crowdin translation server (https://crowdin.com) synchronization plugin
Set-Hash-Keys VANHOESEL 0.01 Treat Hashes as Sets, based on the keys only
Sub-Params BARNEY v1.0.0 Handle function arguments
Syntax-Keyword-Dynamically PEVANS 0.01 dynamically change the value of a variable
TT2-Play-Area NEWELLC 0.001 Simple site to allow playing with TT2 syntax and built in plugins.
Task-QuadPres SHLOMIF 0.0.1 install the CPAN dependencies of Quad-Pres.
Test-Deeply-Float PERLANCAR 0.001 Test equality of data structure, compare numbers with tolerance
Test-Harness-KS KIVILAHTI 0.001 Harness the power of clover and junit in one easy to use wrapper.
Test-Module BALAJIRAM 0.001 brief summary of what this module is used for
Test-New-Module BALAJIRAM 0.001 brief summary of what this module is used for
TextFileParser BALAJIRAM 0.1821900 a Perl extension to ease the parsing of text files. Can be used as a base class to write your own parser.
Unicode-Homoglyph-Replace BIGPRESH 0.01 replace homoglyphs with their ASCII lookalike equivalents
WHO-GrowthReference-Table PERLANCAR 0.001 Lookup height/weight in the WHO growth chart (a.k.a. growth reference, growth standards)
WWW-ELISA VPEIL 0.01 a module for working the the REST API ELi:SA (https://elisa.hbz-nrw.de/)
WWW-Scrape-BillionGraves NHORNE 0.01 Scrape the BillionGraves website
Weather-Fetch BRADHEFF 0.01 a module that fetches the weather
WebService-Mocean KIANMENG 0.01 Perl library for integration with MoceanSMS gateway, https://moceanapi.com.
Win32-Console-PatchForRT33513 KUERBIS 0.001 Patch for RT33513.
decorators STEVAN 0.01 Apply decorators to your methods
elf-sign PRIVI 0.02 X509 signing of elf execuables
lib-archive TOMK 0.1 load pure-Perl modules directly from TAR archives
namespace-lexical TOBYINK 0.001 like namespace::clean but instead of deleting subs, makes them lexical
namespace-local KHEDIN 0.02 Confine imports to the current scope
overload-x LNATION 0.01 The great new overload::x!
perl5-Data-MoneyCurrency EDF 0.04 Get currency information for different currencies
plenigo PLENIGO 0.2 plenigo Perl SDK

List of new CPAN distributions – Jul 2018

dist author version abstract
AI-MXNet-Gluon-Contrib SKOLYCHEV 1.3 Perl interface to MXNet Gluon Contrib
AI-MXNet-Gluon-ModelZoo SKOLYCHEV 1.3 Perl interface to MXNet Gluon ModelZoo
Acme-CPANModules-CLI-Sort PERLANCAR 0.001 Various CLIs to perform sorting
Acme-JTM-Experiment JMASLAK 1.182080 Testing Perl Constructs on CPAN Testers
Alien-Build-Plugin-Cleanse-BuildDir SLAFFAN 0.01 Alien::Build plugin to cleanse the build dir
Alien-caca YANICK 0.0.1 Alien package for the Colored ASCII Art library
Alt-Alien-cmake3-System PLICEASE 0.0401 Simplified alternative to Alien::cmake3 that uses system cmake
App-SlowQuitApps DCONWAY 0.000002 Simplify configuration of SlowQuitApps app on MacOS
App-ansifold UTASHIRO 0.01 fold command handling ANSI terminal sequences
App-cointoss TULAMILI 0.12 The command "cointoss" for a Bernoulli and a binomial distribution as well is provided.
App-colorplus TULAMILI 0.31 The great new App::colorplus!
App-csv2tsv TULAMILI 0.51 A command line utility "csv2tsv" for easy and fairly properly transforming from CSV to TSV.
App-freqtable PERLANCAR 0.001 Print frequency table of lines/words/characters/bytes/numbers
App-githook_perltidy MLAWREN v0.11.9 run perltidy and podtidy before Git commits
App-horsekicks TULAMILI 0.13 The great new App::horsekicks!
App-keycommon TULAMILI 0.0010 You can combine multiple TSV (also machine-readable CSV) files which share a common key column.
App-lensort PERLANCAR 0.001 Sort lines of text by their length
App-matrixpack TULAMILI 0.0012 The great new App::matrixpack!
App-randskip TULAMILI 0.0003 Samples lines randomly with an efficient internal mechanism – a random number is generated per a output line not per an input line – both with replacement and without replacement.
App-shufflerow TULAMILI 0.32 A command utility of shuffling the lines (even the paragraphs) with many useful functions together.
App-summ PERLANCAR 0.001 Print summary statistics of a series of numbers
App-t1generate TULAMILI 0.23 The generator of random numbers obeying the Cauchy distribution (t distribution with df = 1).
App-t2generate TULAMILI 0.23 The generator of random numbers obeying the Cauchy distribution (t distribution with df = 2).
App-unichar BDFOY 0.012 get info about a character
Astro-Coord-ECI-TLE-Iridium WYANT 0.099_01 Class to compute Iridium Classic flares
Bencher-Scenarios-DateTimeFormatDurationISO8601 PERLANCAR 0.001 Scenarios to benchmark DateTime::Format::Duration::ISO8601
Bencher-Scenarios-DateTimeFormatISO8601 PERLANCAR 0.001 Scenarios to benchmark DateTime::Format::ISO8601
Bencher-Scenarios-DateTimeFormatISO8601Format PERLANCAR 0.001 Scenarios to benchmark DateTime::Format::ISO8601::Format
BioSAILs-Command JILLROWE 1.0 Command line wrapper for the BioX-Workflow-Command and HPC-Runner-Command libraries.
CellBIS-Random YUSRIDEB 0.1 Tool for Randomize characters in strings.
CellBIS-SQL-Abstract YUSRIDEB 0.1 SQL Abstract
Config-HAProxy SGRAY 1.00 Parser for HAProxy configuration file
DBIx-CSV PERLANCAR 0.001 Generate CSV from SQL query result
DBIx-Class-Helper-Row-Enumeration RRWO v0.1.0 Add methods for emum values
DBIx-Conn-MySQL PERLANCAR 0.001 Shortcut to connect to MySQL database
DBIx-Conn-Pg PERLANCAR 0.001 Shortcut to connect to PostgreSQL database
DBIx-Conn-SQLite PERLANCAR 0.001 Shortcut to connect to SQLite database
DBIx-TSV PERLANCAR 0.001 Generate TSV from SQL query result
Devel-MAT-Dumper PEVANS 0.36 write a heap dump file for later analysis
Dist-Zilla-Plugin-TestML1Includer INGY 0.0.1 Ship your TestML1 version
Dist-Zilla-PluginBundle-ATOOMIC ATOOMIC 1.00 ATOOMIC's plugin bundle
EPFL-Net-SSLTest WILLBELL 1.00 Website SSL accessibility validator
EPFL-Net-ipv6Test WILLBELL 1.00 Website IPv6 accessibility validator API
Email-Extractor PAVELSR 0.01 Fast email crawler
File-AddInc HKOBA 0.001 FindBin(+ use lib) alike for *.pm modulino (instead of *.pl)
File-Find-CaseCollide SHLOMIF 0.0.1 find collisions in filenames, differing only in case
Finance-Currency-Convert-Mandiri PERLANCAR 0.001 Convert currency using Bank Mandiri
Git-LowLevel BYTERAZOR 0.1 LowLevel Blob/Tree/Commit operations on a GIT Repository
HO-class SKNPP 0.06 class builder for hierarchical objects
HiD-Generator-BibtexPage BYTERAZOR 0.2 HiD Bibtex publication list page generator
JavaScript-V8-XS GONZUS 0.000002 Perl XS binding for the V8 JavaScript engine
Model-Envoy-Storage-Redis HOWARS v0.1.0 A Model::Envoy plugin for peristing model information in a Redis store.
Mojolicious-Plugin-InputValidation FROGGS 0.01 Validate incoming requests
Mojolicious-Plugin-Loco WROG 0.001 launch local GUI via default web browser
Mojolicious-Plugin-Status SRI 0.01 Mojolicious server status
MooX-Enumeration TOBYINK 0.001 shortcuts for working with enum attributes in Moo
Net-EGTS RSHADOW 0.01 Perl Interface to EGTS protocol. GOST R 56360-2015.
Net-IP-Checker PAVELSR 0.01 IPv4/IPv6 addresses validator
Net-Statsd-Client-Telegraf PVIGIER 0.1 Send data to the statsd plugin of telegraf, with support for influxDB's tagging system
Net-Wireless-802_11-Scan-FreeBSD VVELOX v0.0.0 A interface to the wireless interface AP scanning built into ifconfig on FreeBSD
OmniDisco-Prometheus ADUITSIS 0.001 Class representing a Prometheus metric
POE-Filter-ThruPut BINGOS 1.00 a POE filter that passes data through unchanged whilst counting bytes sent and received
Perl-Critic-MergeProfile SKIRMESS 0.001 merge multiple Perl::Critic profiles into one
Perl-LanguageServer GRICHTER 0.01 Language Server for Perl
Plack-Middleware-LogStderr AMALEK 0.001 Everything printed to STDERR sent to psgix.logger or other logger
Prometheus-Tiny ROBN 0.001 A tiny Prometheus client
Prometheus-Tiny-Shared ROBN 0.001 A tiny Prometheus client backed by a shared memory region
QuickTermChart-QuickTermChart SHADKAM 0.01 QuickTermChart/QuickTermChart.pm
SemanticWeb-Schema RRWO v0.0.1 Moo classes for http://schema.org/ classes
Sport-Analytics-NHL ROMM 1.00 Interface to the National Hockey League data
Template-Plugin-URI DBOYS 0.01 A Template Plugin To Use URI Objects
Test-Deep-HashRec RJBS 0.001 test hash entries for required and optional fields
Tex-Hyphen-Pattern IPENBURG 0.100 class for providing a collection of TeX hyphenation
Text-ANSI-Fold UTASHIRO 0.01 Text folding with ANSI sequence and Asian wide characters.
Text-Locus SGRAY 1.00 text file locations
Text-Table-ASV PERLANCAR 0.001 Generate TSV
Time-Random LNATION 0.01 Generate a random time in time.
Transport-AU-PTV PUGLET 0.01 access Melbourne public transport data.
Types-HTML5 TOBYINK 0.001 types for parsing strings of HTML into DOMs
WebService-Hexonet-Connector HEXONET 1.01 Connector library for the insanely fast Hexonet Backend API.
WebService-KvKAPI WATERKIP 0.001 Query the Dutch Chamber of Commerence (KvK) API
WordPress-DBIC-Schema MELMOTHX 1.00 Database schema for WordPress
Yandex-Geo PAVELSR 0.01 Performs queries using Yandex Maps Company Search API
getemails PAVELSR 0.01 Fast email crawler
githook-perltidy MLAWREN v0.11.7_1 run perltidy and podtidy before Git commits
quick_term_chart SHADKAM 180718 a light perl script to quickly draw chart within the terminal input data can be piped to it
ygeo PAVELSR 0.01 command line utility based on Yandex::Geo that prints data to csv