Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??

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:

  1. Downgrade to perl 5.8 -- sucks because I'd have to give up // operator, among other things.
  2. Rewrite Getopt::Euclid's regex code -- Danger, danger Will Robinson.
  3. Switch to another Getopt module -- painful refactoring.
  4. Build custom version of perl -- possible vain hope that compiler optimization settings will affect regex actions.
  5. Switch to ActiveState perl -- best of the lot, but will lose shebang (i.e. #!) ability in cygwin scripts.

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

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others scrutinizing the Monastery: (15)
    As of 2014-07-23 10:05 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      My favorite superfluous repetitious redundant duplicative phrase is:









      Results (139 votes), past polls