in reply to matching against failed readline doesn't warn?

I think that you can rule out the regular expression engine from being a key part of this oddity. The following pair shows the same behaviour:
perl -we'open FOO, "/dev/null";$x=<FOO>; print scalar $x' perl -we'open FOO, "/dev/null"; print <FOO>'
And it isn't just print either:
perl -we'open FOO, "/dev/null"; $x=<FOO>; print $x+2' perl -we'open FOO, "/dev/null"; $x=2+<FOO>; print $x'
demonstrates the same oddity. However:
perl -we'open FOO, "/dev/null"; print defined <FOO>'
notices that the value is undef.

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
    perl -we'open FOO, "/dev/null"; print <FOO>'
    This one has <FOO> in list context, so an empty list is returned. No warnings when printing an empty list isn't to be taken as a surprise.

    Abigail