Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
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 taking refuge in the Monastery: (5)
As of 2014-12-19 04:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (70 votes), past polls