in reply to Re^2: Detecting Last line of a file
in thread Detecting Last line of a file

Why wouldn't it be done the first time? That doesn't work unless $content[0] is somehow false .. since we're looping through @content and they're presumably all non-false, then $address is always set. Best way to get rid of the temp var is to just use split, or dpending on context (i.e. if you're reading a file) you could do print "," if $. > 1;.

Replies are listed 'Best First'.
Re^4: Detecting Last line of a file
by GrandFather (Saint) on Jun 19, 2005 at 04:44 UTC

    Quite right. That's what comes of answering before coffee! I was thinking in terms of concatenating the addresses into a variable which would be undef the first time round.


    Perl is Huffman encoded by design.