/usr/bin/perl use strict; use warnings; my @numbers = ( [qw( Italian Spanish French )], [qw( uno uno un )], [qw( due dos deux )], [qw( tre tres trois )], [qw( quattro quatro quatre )], [qw( cinque cinco cinq )], [qw( sei seis six )], [qw( sette siete sept )], [qw( otto ocho huit )], [qw( nouve nueve neuf )], [qw( dieci diez dix )], ); 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 our 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 = <>; }