mikeraz has asked for the wisdom of the Perl Monks concerning the following question:
Given:
This triggers a warning of Use of uninitialized value in concatenation (.) or string whenever the regex matches.while(<>) { s/(\d),(?=\d)/$1|$2/g; print; }
Which I don't comprehend:
$_ is defined
$1 and $2 are both defined when the match occurs.
So why does the warning trigger?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: regex match triggers "Use of unititialized value ..." warning
by BrowserUk (Patriarch) on Feb 22, 2011 at 02:30 UTC | |
by mikeraz (Friar) on Feb 22, 2011 at 13:00 UTC | |
|
Re: regex match triggers "Use of unititialized value ..." warning
by hsinclai (Deacon) on Feb 22, 2011 at 02:34 UTC | |
|
Re: regex match triggers "Use of unititialized value ..." warning
by toolic (Bishop) on Feb 22, 2011 at 02:32 UTC | |
by mikeraz (Friar) on Feb 22, 2011 at 02:42 UTC | |
by mikeraz (Friar) on Feb 22, 2011 at 02:44 UTC |