- or download this
$ echo -n "0" | perl -E'while(<>) { say "GOT" }'
GOT
$ echo -n "0" | perl -E'while(<> and 1) { say "GOT" }'
$
- or download this
$ echo "Hello" | perl -E'while(<>){ print $_ }'
Hello
$ echo "Hello" | perl -E'<>; print $_'
$
- or download this
while (defined($_ = <$fh>))