From: Mike Burns <[EMAIL PROTECTED]>
   Date: Thu, 24 Oct 2002 18:49:29 -0400

   Just a generic question (i.e. any examples are not real examples, so don't
   solve them by themselves):

   .* has a restriction of 32767 characters. Any ways around this?

   (The context is the Parse::Any2xml module, which sadly has yet to be
   CPAN-released but is on goreliance.com/devel .)

   Say I have:

    $f =~ /(.*)/;
    $1 =~ /(monkey)\s+foo(\d{20})/;

   (With a lot more context to make it not look silly :) 
   From this I expected $f and $1 to be eqaul; however, if length($f) is
   greater 32767 then $f is not equal to $1;

If there is such a limit in perl 5.6.1, I can't find it:

        rgr> perl -e '$foo = "abcdef" x 10000; $foo =~ /(.*)/; print length($1), "\n";'
        60000
        rgr> perl -e '$foo = "abcdef" x 100000; $foo =~ /(.*)/; print length($1), 
"\n";'
        600000
        rgr> 

What version are we talking about here?

   In any case, my first thought was to use

        /((........)*.*)/

to get around any closure limitations, with as many extra dots as you
need, call it N, and an extra ".*" for strings that aren't multiples of
N.  But obviously I can't test this myself . . .

                                        -- Bob Rogers
                                           http://rgrjr.dyndns.org/
_______________________________________________
Boston-pm mailing list
[EMAIL PROTECTED]
http://mail.pm.org/mailman/listinfo/boston-pm

Reply via email to