Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: from array to hash with grep

by ioannis (Priest)
on Jun 15, 2006 at 08:19 UTC ( #555447=note: print w/ replies, xml ) Need Help??


in reply to from array to hash with grep

Since it is fixed-length scanning, we can use pack() and unpack():

my @inp = ("abc_A_bla", "abc_B_bla", "abc_C_bla") ; print "@{[ keys %{{ unpack '(x4 A A4)*', pack( '(A*)*', @inp) }}]}";


Comment on Re: from array to hash with grep
Download Code

Log In?
Username:
Password:

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

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

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





    Results (47 votes), past polls