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


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"

Replies are listed 'Best First'.
Re^2: delete hash slice from a hashref wont return vals?
by misterperl (Pilgrim) 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!