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

Re: Accessing or printing key and value

by frozenwithjoy (Curate)
on Dec 11, 2012 at 00:38 UTC ( #1008198=note: print w/ replies, xml ) Need Help??


in reply to Accessing or printing key and value

The way you are loading your hash looks odd. I suggest putting something this into your loop: $ARG{$tab1} = $tab2; instead of push(@ {$ARG{"$tab1"}},"$tab2");. (EDIT: nevermind about that, I just realized you are going for a hash of arrays) Also, be sure to include use warnings; use strict;, if you aren't already doing so.

As I understand it, the column you want to sort by is also the key, right? If so, change foreach  $string  (keys %ARG) { to foreach $string ( sort keys %ARG ) { (otherwise, the order will be 'random').


Comment on Re: Accessing or printing key and value
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (13)
As of 2014-09-18 18:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (120 votes), past polls