Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^3: Sorting array

by rkk (Novice)
on Jun 15, 2013 at 02:48 UTC ( #1039064=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Sorting array
in thread Sorting array

I am getting some error..BTW I have created the above mentioned @arr using following command

push(@arr,($l2[6],$l2[7]));

But you you specified

my @arr = ( [ ch1=> 100 ], [ ch2=> 20 ], [ ch11=> 13 ], [ ch2 => 45 ], + [ ch1=> 1 ] );

please advise changes in my command to get a format like you specified. Thanks in advance..


Comment on Re^3: Sorting array
Select or Download Code
Re^4: Sorting array
by rkk (Novice) on Jun 15, 2013 at 02:55 UTC

    I figured it out.. I need to use [] instead of ()..

    Never mind..

Re^4: Sorting array
by NetWallah (Abbot) on Jun 15, 2013 at 02:57 UTC
    Try:
    push @arr, [ $l2[6], $l2[7] ];
    See " perldoc perllol" to understand how this works.

                 "The trouble with the Internet is that it's replacing masturbation as a leisure activity."
            -- Patrick Murray

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (15)
As of 2015-07-02 09:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (33 votes), past polls