|
|
| Syntactic Confectionery Delight | |
| PerlMonks |
Re^3: Error: Use of uninitialized value $item in concatenation (.) or string at...by ig (Priest) |
| on Jun 10, 2011 at 21:04 UTC ( #909204=note: print w/ replies, xml ) | Need Help?? |
|
This might be the source of one of your uninitialized values. See perlre for details of the match variables ($1, $2, etc.). The important thing here is that these variables are reset by the next successful match. If your substitution to remove commas finds any, then it is a successful match, after which $1 and $2 are reset to undef. Thus, if $nocomma_sent has any commas in it, when you push $1 onto your array you will be pushing undef. One way to avoid this is to push $1 before performing the substituion:
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||||