in reply to matching against failed readline doesn't warn?
And it isn't just print either:perl -we'open FOO, "/dev/null";$x=<FOO>; print scalar $x' perl -we'open FOO, "/dev/null"; print <FOO>'
demonstrates the same oddity. However:perl -we'open FOO, "/dev/null"; $x=<FOO>; print $x+2' perl -we'open FOO, "/dev/null"; $x=2+<FOO>; print $x'
notices that the value is undef.perl -we'open FOO, "/dev/null"; print defined <FOO>'
UPDATE: Fixed the scalar issue that both Abigail-II and ysth pointed out to me. (It didn't make a difference in the warning behaviour.)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: matching against failed readline doesn't warn?
by Abigail-II (Bishop) on Apr 08, 2004 at 09:14 UTC |