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.
In reply to Re^5: Error: Use of uninitialized value $item in concatenation (.) or string at...
by AnomalousMonk
in thread Error: Use of uninitialized value $item in concatenation (.) or string at...
by jonc
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |