Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: how to make first element of an string as a the array name

by thezip (Vicar)
on Nov 15, 2007 at 00:13 UTC ( #650878=note: print w/ replies, xml ) Need Help??


in reply to how to make first element of an string as a the array name

Why not make it a hash of array references, as in:

use strict; use warnings; use Data::Dumper; my $hash = { 'IL12::1::287' => [6,-17,-9,-21,-24,-15,-2,11,4,4,-15,-26, ...], 'IL12::1::329' => [-25,-18,-28,23,17,1,-3,-23], ... } print Dumper($hash);

You'll need to split each line and shift off the first element to get the hash key (ie. 'IL12::1::287').

I'm not sure which lines you're going to compare. Could you please explain this more?


Where do you want *them* to go today?


Comment on Re: how to make first element of an string as a the array name
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (7)
As of 2014-12-27 12:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

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





    Results (177 votes), past polls