Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

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

by RollyGuy (Chaplain)
on Sep 11, 2002 at 13:40 UTC ( [id://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;
into
$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?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (3)
As of 2024-04-25 19:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found