Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: How to differentiate an empty array from an unitialized one?

by tinita (Parson)
on Jul 08, 2018 at 21:49 UTC ( #1218127=note: print w/replies, xml ) Need Help??


in reply to How to differentiate an empty array from an unitialized one?

See split. You can give an extra argument called LIMIT:
my @array = split m/,/ , $_, -1;
From perldoc -f split:
If LIMIT is negative, it is treated as if it were instead arbitrarily large; as many fields as possible are produced.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (3)
As of 2019-10-19 05:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?