Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

Re: Re:x4 Using hash elements to create a string

by RollyGuy (Chaplain)
on Sep 11, 2002 at 13:40 UTC ( #196939=note: print w/replies, xml ) Need Help??

in reply to Re:x4 Using hash elements to create a string
in thread Using hash elements to create a string

In your for loop that creates the hash, you are using just $j as the key to the hash. That will result in the keys just being numbers. You actually want the keys to be the values in the array @views that correspond to the entry $j. So you will need to change:
$hash{$j} = \@array;
$hash{$views[$j]} = \@array;

As an additional note, the perl debugger will easily print out structures like hashes so that you can ensure they are created properly. Use the command 'perldoc perldebug' to read the documentation when you get a chance.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (1)
As of 2022-08-09 23:46 GMT
Find Nodes?
    Voting Booth?

    No recent polls found