#!perl use strict; use warnings; use feature qw/ say /; my %hash = ( 4 => 'The future is unknown.', 1 => 'The day before yesterday sucked.', 2 => 'Yesterday was no better.', 5 => 'Today is a good day.', 3 => 'Not much hope for tomorrow.', ); my @output_lines; while (my ($number, $string) = each %hash) { $output_lines[$number] = $string; } for ( @output_lines ) { say $_; } __END__ ## Output: Use of uninitialized value $_ in say at ./foo.pl line 22. The day before yesterday sucked. Yesterday was no better. Not much hope for tomorrow. The future is unknown. Today is a good day.