in reply to Upgrade to 5.18 causes uninitialized ${^MATCH}

G'day nbtrap,

Welcome to the monastery.

I'm using 5.18.0. Without any context or knowledge of the values of $buf, $pat, $self or $sub, I am unable to reproduce your problem.

pos() and ${^MATCH} are returning the values I would expect:

$ perl -Mstrict -Mwarnings -E ' my $buf = q{aXa}; while ($buf =~ /a/gp) { say q{pos($buf):}; say pos($buf); say q{${^MATCH}:}; say ${^MATCH}; } ' pos($buf): 1 ${^MATCH}: a pos($buf): 3 ${^MATCH}: a

perldelta (for 5.18.0) mentions a change to ${^MATCH} under Internal Changes which may be relevant.

perldoc.perl.org hasn't updated to 5.18.0 yet. If you're using online documentation, I suggest using the CPAN perl 5.18.0 doco. (The commandline perldoc utility is up-to-date.)

You may get some hints for creating a short, self-contained script that reproduces your problem from "How do I post a question effectively?".

-- Ken

Replies are listed 'Best First'.
Re^2: Upgrade to 5.18 causes uninitialized ${^MATCH}
by nbtrap (Sexton) on May 29, 2013 at 01:54 UTC

    Thank you. I'm aware of the changes documented in the 5.18 manual pages, but none of them seemed to address this problem. And I know a working script would have been very helpful, but I couldn't get this to work outside the context of my rather large program, so I decided to cross my fingers and hope someone else might be experiencing the same thing.