Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: making an array out of a string or integer

by ColtsFoot (Chaplain)
on Feb 12, 2002 at 15:50 UTC ( [id://144888]=note: print w/replies, xml ) Need Help??


in reply to making an array out of a string or integer

Yes sure use split()
$val = 12345; @valary = split('', $val); foreach $item (@valary) { print $item,qq(\n); }
The '' parameter in split() says split on nothing
Hope that helps

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (6)
As of 2024-04-23 14:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found