in reply to Re^2: Use of uninitialized value in pattern match (m//)
in thread Use of uninitialized value in pattern match (m//)
The part in parens produces an anonymous array that the "for" will iterate over, and the last element of that array the "undef" element from the last attempt to read from the file handle and encountering 'eof'. If you used a while loop instead, you wouldn't enter the block (lines 25 and 26 would not be reached) on that last attempt to read from the file.for $line (<FILE>) {
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Use of uninitialized value in pattern match (m//)
by Anonymous Monk on Mar 18, 2015 at 01:24 UTC | |
by graff (Chancellor) on Mar 18, 2015 at 01:36 UTC |