SPUG: A bug?

Yitzchak Scott-Thoennes sthoenna at efn.org
Tue Jul 15 17:55:51 CDT 2003

On Tue, 15 Jul 2003 15:16:59 -0700 (PDT), itayf at fhcrc.org wrote:
>  'ioctl-test.pl FILE'
>  'Inappropriate ioctl for device'
>and fails when tested for $!.
>In contrast,
>  'cat FILE | ioctl-test.pl'
>prints nothing (as expected? :-).

$! is meaningless unless there has been an error.  When <> (aka readline)
returns undef and you want to check for an error, first call eof.  If
it wasn't eof, then check $!.

More information about the spug-list mailing list