Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

Re: Elegance, dammit!

by sfink (Deacon)
on Jun 16, 2007 at 21:10 UTC ( #621621=note: print w/replies, xml ) Need Help??

in reply to Elegance, dammit!

Purely for completeness.

Option 1:

while (@ref) { my $k = shift(@ref); $out{$k} = [ shift(@ref), shift(@ref) ]; }
or if the temporary bothers you:
while (@ref) { $out{$_} = [ shift(@ref), shift(@ref) ] for shift(@ref); }

Option 2: Change your SQL to something like SELECT key, value1, key, value2, then do:

push @{ $out{shift(@ref)} }, shift(@ref) while (@ref);
Personally, I'd stick with your original.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://621621]
[Lotus1]: damn, I just opened the attacment on a phishing simulation email in the $work email
[Lotus1]: now I'll be sent to re-education camp or something
[stevieb]: relocate Lotus1 to the brig, straight away!

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (13)
As of 2017-05-24 13:38 GMT
Find Nodes?
    Voting Booth?