in reply to Re: Re: How to get the number of fields found by split without a warning?
in thread How to get the number of fields found by split without a warning?

Still not a problem (but you knew that)(:
E:\>perl -le"die $_ = () = split ',','a,b,c,d,e,f,g',-1" 7 at -e line 1.

MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
** The third rule of perl club is a statement of fact: pod is sexy.

  • Comment on Re: Re: Re: How to get the number of fields found by split without a warning?
  • Download Code

Replies are listed 'Best First'.
Re: Re: Re: Re: How to get the number of fields found by split without a warning?
by bart (Canon) on Dec 08, 2003 at 21:36 UTC
    Except that it won't drop trailing blank fields, as it should. If you don't care about this, you needn't use split.
    print $_ = () = split ',','a,b,c,,,,',-1
    7