My problem is I use Getopt::Euclid extensively and after I upgraded to perl 5.10 on cygwin it broke. Cracking open the code it looks like the extended regex construct (?{}) is the source of my woes. In the perlre docs that construct has the following notice:
"WARNING: This extended regular expression feature is considered experimental, and may be changed without notice. Code executed that has side effects may not perform identically from version to version due to the effect of future optimisations in the regex engine."
I guess I was warned, but I had no idea Getopt::Euclid was built on such a fragile construct.
All my options look bad, so I hope someone sees an alternative to the following:
Like I said, I only see bad options. Any help or advice would be appreciated.
Scott B.
P.S. Here is the reduced test case:
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 comman +d 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;
And here are the results. Note that $ARGV{WHEN} is undefined in the second (cygwin) example. That wreaks havoc on Getopt::Euclid.
: 2009-02-10 19:56:05 (C:/Perl510/bin/perl regex_test.pl) Perl 5.10.0 on MSWin32: $ARGV = { 'WHEN' => '12:34' }; $string = 'It is thyme'; : 2009-02-10 19:56:05 (perl regex_test.pl) Perl 5.10.0 on cygwin: $ARGV = { 'WHEN' => undef }; $string = 'It is thyme';
In reply to Getopt::Euclid victim of 5.10 upgrade by scott\b
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |