while (my ($key, $value) = each @ARGV) { print "$value: $key\n"; # The key is the position } #### use Data::Dumper; print Dumper { %ARGV[0,1,3] };