@array = ( 4, 1, 3, 2 ); print shift @{[sort @array]}; # Prints 1 print shift @{$sorted_ref = [sort @array]}; # Prints 1 and stores remaining values