in reply to Re^3: ${^MATCH} regex special variable(s) and /p regex modifier
in thread ${^MATCH} regex special variable(s) and /p regex modifier
Yes, but it seems anything but a literal string will make the variable defined.
$ perl -wE 'my $s = "foo 123"; $s =~ /\d+/; say ${^PREMATCH}' foo
|
---|
In Section
Seekers of Perl Wisdom