Your skill will accomplish what the force of many cannot |
|
PerlMonks |
delete hash slice from a hashref wont return vals?by misterperl (Pilgrim) |
on Aug 21, 2013 at 14:26 UTC ( [id://1050357]=perlquestion: print w/replies, xml ) | Need Help?? |
misterperl has asked for the wisdom of the Perl Monks concerning the following question:
Things that make u go HUH..
I'm trying something like: ($cgi is a hashref, @KEYS = keys %$cgi) If I try: die join ',',@$cgi{@KEYS} I get a list of values from the hash, as expected. All is good. BUT, if I try my @vals = delete @$cgi{@KEYS} I get an array of length @KEYS, each element empty ( eq ''), even though the array has values I can see in the die? delete should return an array of the values from the deleted slice? I humbly seek counsel. I don't get it. PS I should have mentioned - YES, the hash elements are indeed deleted... I just cant get the vals back....
Back to
Seekers of Perl Wisdom
|
|