#!/usr/bin/perl use warnings; use strict; my @array = ( 'A', 1, 'B', 2, 'C', 3, 'A', 4 ); my %hash = @array; for (sort keys %hash ) { print "$_ => $hash{$_}\n"; } print "\n"; #### C:\Code>perl array-hash-order.pl A => 4 B => 2 C => 3