in reply to How to get the number of fields found by split without a warning?
If you're really determined to do this, you could use the =()= pseudo-operator:
my $n =()= split ',', $str;
Update: Quite right bart, I left out the 3rd arg to split(), the correct code is as follows.
my $n =()= split ',', $str, -1;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: How to get the number of fields found by split without a warning?
by bart (Canon) on Dec 08, 2003 at 21:15 UTC | |
by PodMaster (Abbot) on Dec 08, 2003 at 21:28 UTC | |
by bart (Canon) on Dec 08, 2003 at 21:36 UTC | |
|
Re: Re: How to get the number of fields found by split without a warning?
by Not_a_Number (Prior) on Dec 08, 2003 at 21:17 UTC |