Help for this page

Select Code to Download


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