in reply to Print only if pattern matches
> Use of uninitialized value $2 in concatenation (.) or string at split_test.pl li
> I am looking to get rid off the error. ... ANd I want to write the exceptions to new file.
so avoid uninitialized '$2'!
if (defined $2) { print "$1$2|$3\n"; } else { print $exception_fh "$_\n"; }
|
---|
In Section
Seekers of Perl Wisdom