in reply to Re: Help to identify Error in my program
in thread Help to identify Error in my program

I don't understand why they used <>. This returns the first line of the first file passed. Not the first argument on the command line.
You're right they'd have to chomp it if the filenames were listed at the start of each file but seeing as I don't think they meant that. shift of the @ARGV array is fine and wouldn't need chomping.

Replies are listed 'Best First'.
Re^3: Help to identify Error in my program
by blazar (Canon) on Oct 21, 2008 at 09:58 UTC

    I personally believe that he's not passing any file on the command line, (the other filename is hardcoded some lines below...) in which case it will read the first line from STDIN, but certainly, if he wanted to rely on this behaviour then he should have used <STDIN>. Just one out of many gotchas in a lump of bad code.

    --
    If you can't understand the incipit, then please check the IPB Campaign.