in reply to split'ing lines with variable number of fields

damn - I always get beaten to the first reply! the now* obligatory "well here's my 0.02p worth".

Perl provides the ||= orequals operator which is used in the following way...

$second ||= $first;
Your code above allows for $second to be 0 (zero) and is perfectly readable. This (||=) way will not test for defined but for a true value so if $second is not allowed to be 0 (zero) then this is ideal (and more succinct). Otherwise, leave it how it is.

Hope this helps, larryk

* now that I'm not first to reply!

"Argument is futile - you will be ignorralated!"