Think about Loose Coupling | |
PerlMonks |
Re: How to get the number of fields found by split without a warning?by talexb (Chancellor) |
on Dec 08, 2003 at 20:55 UTC ( [id://313231]=note: print w/replies, xml ) | Need Help?? |
As you've probably read, split returns an array, so I'd recommend you take advantage of that and afterwards count the number of elements in the array.
The '+1' is required because array offsets start at zero.
--t. alex
Life is short: get busy! Update: Or, as Corion pointed out, scalar(@n) which is much clearer.
In Section
Seekers of Perl Wisdom
|
|