in reply to Preventing Use of uninitialized value.
Don't test for a match if there is no line:
if (defined $line and $line =~ /(\bTest\b\s+.+\s+\baccount\b)?/)
(Update: added parens to handle precedence of //, thx to choroba)if ( ($line // '') =~ /(\bTest\b\s+.+\s+\baccount\b)?/)
Hope this helps!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Preventing Use of uninitialized value.
by choroba (Cardinal) on Dec 13, 2018 at 17:05 UTC | |
by 1nickt (Canon) on Dec 13, 2018 at 18:27 UTC |