sub some_sub{ my $item = shift; #assign the first element of @_ to $item my ($string); if ($item == 1){ #note == not = or = = $string = 'one'; } if ($item == 2){ $string = 'two'; } # and so on ... print "My number is $string." }