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

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

by tinita (Parson)
on Jul 08, 2018 at 21:49 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1218127]
help
Chatterbox?
and the web crawler heard nothing...

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

    No recent polls found