/usr/bin/perl use strict; use warnings; my @numbers = ( [qw( Italian Spanish French English Welsh )], [qw( uno uno un one un )], [qw( due dos deux two dau )], [qw( tre tres trois three tri )], [qw( quattro quatro quatre four pedwar )], [qw( cinque cinco cinq five pump )], [qw( sei seis six six chwech )], [qw( sette siete sept seven saith )], [qw( otto ocho huit eight wyth )], [qw( nouve nueve neuf nine naw )], [qw( dieci diez dix ten deg )], ); print "Please enter number to translate\n"; my $num = <>; while ($num) { print "You typed $num\n"; chomp $num; for my $row (@numbers) { # dereference array, and look for out number in it next unless grep {/$num/} @$row; print "I found it: "; print join " <-> ", @$row; print "\n"; my $i = 0; $i ++ until $row->[$i] eq $num; print "It looks like it was in $numbers[0]->[$i]\n"; last; } print "Please enter another number to translate\n"; $num = <>; }