|go ahead... be a heretic|
How to get the number of fields found by split without a warning?by Rudif (Hermit)
|on Dec 08, 2003 at 20:36 UTC||Need Help??|
Rudif has asked for the wisdom of the Perl Monks concerning the following question:
I wanted get the number of fields found by split into a scalar, and I got it, but with a warning thrown in
perlfunc says this
In scalar context, returns the number of fields found and splits into the @_ array. Use of split in scalar context is deprecated, however, because it clobbers your subroutine arguments.
OK, that's helpful.
But what is the best way to get rid of this warning? I came up with these two so far
Any other ideas?