Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Getopt::Euclid victim of 5.10 upgrade

by JavaFan (Canon)
on Feb 13, 2009 at 10:45 UTC ( #743583=note: print w/ replies, xml ) Need Help??


in reply to Getopt::Euclid victim of 5.10 upgrade

I get:

Perl 5.8.9 on linux: $ARGV = { 'WHEN' => '12:34' }; $string = 'It is thyme';
and
Perl 5.10.0 on linux: $ARGV = { 'WHEN' => '12:34' }; $string = 'It is thyme';
Considering that the MSWin32 Perl also gives you what you want, I'd say you encountered a bug in the cygwin port. It may be worth sending in a bug report; preferably with the code fragment turned into a test.

As for a fix, I've one suggestion. Try turning the my $ARGV into local %ARGV, and use a fully qualified path when refering to $ARGV{WHEN}. But that's just a guess, and since my perl doesn't have the bug in the first place, I cannot test whether it makes a difference.


Comment on Re: Getopt::Euclid victim of 5.10 upgrade
Select or Download Code
Re^2: Getopt::Euclid victim of 5.10 upgrade
by telemachus (Friar) on Feb 13, 2009 at 12:46 UTC

    I don't think that it's Cygwin - or at least not only Cygwin. Here are my results on OS X. The 5.8 is the system Perl, and the 5.10 is my own:

    hektor ~ $ ./retest Perl 5.10.0 on darwin: $ARGV = { 'WHEN' => undef }; $string = 'It is thyme'; hektor ~ $ /usr/bin/perl retest Perl 5.8.8 on darwin: $ARGV = { 'WHEN' => '12:34' }; $string = 'It is thyme';

    A quick second look: I'm now thinking it has something to do with the configuration. These two are from the same machine (Debian Lenny), but they're both 5.10.0. Nevertheless, the results differ. The first 5.10.0 is once again my own build, but the second is Debian's. (I applied a few patches to my own, particularly one to stop a regular expression related memory leak, but I believe that Debian has that patch as well - and more.)

    telemachus ~ $ perl testre Perl 5.10.0 on linux: $ARGV = { 'WHEN' => undef }; $string = 'It is thyme'; telemachus ~ $ /usr/bin/perl testre Perl 5.10.0 on linux: $ARGV = { 'WHEN' => '12:34' }; $string = 'It is thyme';

      Thank you all for your help and insight. Unfortunately, I see little recourse but to abandon my use of Getopt::Euclid. I'm not going to rewrite existing scripts for now, but I won't use Getopt::Euclid for a new research project I am starting.

      The straw that broke the camel's back (so to speak) is the inconsistent failures. It works for me on OS X with perl 5.10 but fails for telemachus. Further, it works with one build of perl 5.10.0 on linux and fails for a different build of 5.10.0 on the same system.

      I lack time and motivation to trace the failure all the way back to perl build configuration settings, especially since it appears that Damian Conway has abandoned Getopt::Euclid.

      Once again, thank you for your help.

      Scott

      P.S. I rewrote my sample code to be a proper Test::More test script. Furthermore, I also reverted to the original regular expression, in case my simplification introduced its own errors.

      That code, when run twice on my system, reports:

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://743583]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2014-08-23 05:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (172 votes), past polls