use strict; use warnings; use Data::Dumper; use Config; use re 'eval'; my %ARGV; my $string = q{It is --now 12:34}; # Mimic Getopt::Euclid's generated regex to process a --now command line # option. $string =~ s{(??{exists $ARGV{WHEN} }) --now\s+(\d+:\d+)(?{$ARGV{WHEN} = $^N}) }{thyme}xsm; print "Perl $Config{version} on $Config{osname}:\n", Data::Dumper->Dump( [ \%ARGV, $string ], [qw(ARGV string)] ); exit 0;