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

Re: delete hash slice from a hashref wont return vals?

by hdb (Prior)
on Aug 21, 2013 at 14:37 UTC ( #1050360=note: print w/ replies, xml ) Need Help??


in reply to delete hash slice from a hashref wont return vals?

It works for me:

use strict; use warnings; my $cgi = { a => 1, b => 2 }; my @keys = keys %$cgi; my @vals = delete @$cgi{ @keys }; print "@vals\n";

prints "1 2"


Comment on Re: delete hash slice from a hashref wont return vals?
Download Code
Re^2: delete hash slice from a hashref wont return vals?
by misterperl (Sexton) on Aug 21, 2013 at 14:56 UTC
    Yes I got it to work in a small example too. I'm starting to think it has something to do with the fact that im revisiting the page and $cgi may be somehow getting altered in a way I'm not seeing.

    Thanks for the reply sir!

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (14)
As of 2014-09-30 14:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

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











    Results (373 votes), past polls