http://www.perlmonks.org?node_id=1050357

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....