Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Re: (Golf) Strings-to-Array

by japhy (Canon)
on Mar 29, 2001 at 04:21 UTC ( #68012=note: print w/ replies, xml ) Need Help??


in reply to Re: (Golf) Strings-to-Array
in thread (Golf) Strings-to-Array

Ooh, very nice. But it clobbers a global $d. Here's my remedy:

# 41 chars sub s2a {my@q;map{my$d;map$q[$d++].=$_,/./sg}@_;@q}
It uses map() in void context, but who cares?

japhy -- Perl and Regex Hacker


Comment on Re: Re: (Golf) Strings-to-Array
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (8)
As of 2014-12-28 23:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (183 votes), past polls