if (eof(EMPLOYEES)) { print "Sorry, your query produced no results.\n"; } else { while (my $line = <EMPLOYEES>) { #remove the carriage return chomp $line; #splits the line between tabs and get the different elements ($name, $city, $language) = split /\t/, $line; next unless $language =~ /$search/; print "$name can speak " . ($search) . " and lives in " . ($city) . ".\n"; } }
In reply to Re: Ending a 'next unless' loop...
by ikegami
in thread Ending a 'next unless' loop...
by chinamox
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |