open FILE, "foo" || die "can't open file"; # assume -T foo for my $line (<FILE>) { my $x = <FILE>; if (!defined($x)) { print "couldn't read from filehandle.\n"; } }
Assume that foo is an arbitrarily large text file.
In reply to nested <FILE> read returns undefined? by argv
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |