#!/usr/bin/env perl use utf8; use Utils; use strict; use warnings; MAIN: { binmode(STDOUT, ":utf8"); binmode(STDERR, ":utf8"); binmode(STDIN, ":utf8"); foreach my $arg (@ARGV) { utf8::decode($arg); } my $names = ["Fred", "Wilma", "Barney", "Betty"]; # Print out the name based on command line argument 1-4 for (my $i = 1; $i <= scalar(@ARGV); ++$i) { my $x = Utils::stoiWithDefault($ARGV[$i - 1], 0); print $i, ":", $names->[$x - 1], "\n"; } }