SPUG: "last" behaving oddly in -n loop

John W. Krahn krahnj at acm.org
Wed Aug 20 18:10:51 CDT 2003


On Wednesday 20 August 2003 15:28, Andrew Sweger wrote:
>
> On Wed, 20 Aug 2003, Tim Maher wrote:
> > I'm confused about how "last" is being handled with a -n
> > (implicit) loop, which is very different from the way "next"
> > is being handled.  I'd appreciate any insights!
>
> It's behaving the way I would expect of "last". I thought the file
> arguments were all run together in the <ARGV> of the while(). If you
> want to detect the end of individual files (while using normal IO
> functions), I thought you need to manually check eof().

Actually, you need to check eof not eof().  :-)

perldoc -f eof



John
-- 
use Perl;
program
fulfillment




More information about the spug-list mailing list