in reply to Re^4: Error: Use of uninitialized value $item in concatenation (.) or string at...
in thread Error: Use of uninitialized value $item in concatenation (.) or string at...
By the way, don't you mean if it _doesn't_ have any commas in it?
If the string had no commas, there would be no successful match in the regex 'search' phase of the substitution, and $1 and $2 and any other capture variables would not be undef-ed. See the substitution statement
$x =~ s/x//g;
that is the second to the last statement in ig's example code in Re^5: Error: Use of uninitialized value $item in concatenation (.) or string at...: the successful match against $x causes all capture variables to be set to the values of their corresponding capture groups, and since there are no capture groups, these values are all undef.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: Error: Use of uninitialized value $item in concatenation (.) or string at...
by jonc (Beadle) on Jun 11, 2011 at 19:05 UTC | |
by AnomalousMonk (Archbishop) on Jun 12, 2011 at 06:43 UTC | |
by ig (Vicar) on Jun 13, 2011 at 10:26 UTC |