Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Ending a 'next unless' loop...

by blueberryCoffee (Scribe)
on Oct 04, 2006 at 05:39 UTC ( #576262=note: print w/replies, xml ) Need Help??


in reply to Ending a 'next unless' loop...

sub query { my $search = shift; while(my $line = <EMPLOYEES>) { if($line =~ /(.*?)\t(.*?)\t.*$search/) { return "$1 speaks $search and lives in $2"; } } return "Sorry, nothin for ya"; } print query("Norse");

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://576262]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2023-02-07 17:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I prefer not to run the latest version of Perl because:







    Results (40 votes). Check out past polls.

    Notices?