- or download this
DB<113> @array = (a =>1,b=>2)
=> ("a", 1, "b", 2)
...
DB<116> \@array # emptied!
=> []
- or download this
while(@array) {
$hash{shift @array} = shift @array;
}
- or download this
DB<108> @array = ( a => 1, b => 2 )
=> ("a", 1, "b", 2)
...
DB<110> \%hash
=> { 1 => "a", 2 => "b" }