Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

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

by Zed_Lopez (Chaplain)
on Dec 08, 2003 at 21:26 UTC ( [id://313247]=note: print w/replies, xml ) Need Help??


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

You can get this without a dummy array assignment with:

my $n = scalar @{[split ',', $str]};

The 'scalar' is optional, but I like it for readability.

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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://313247]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (2)
As of 2024-04-26 03:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found