Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: from array to hash with grep

by ioannis (Monsignor)
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) }}]}";

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://555447]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (3)
As of 2017-11-19 03:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:













    Results (278 votes). Check out past polls.

    Notices?