WarrenBullockIII has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl -w use strict; #get the user input first print "type a string: "; while(<>){ chomp(); if(/Wilma.*Fred|Fred.*Wilma/){ print "$_\n"; } else{ print "\n\nyour line was skipped because it did not mention Fred and W +ilma\n\n"; } }
Edit by tye
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: While loop and pattern match (was Re: need help)
by VSarkiss (Monsignor) on Jun 05, 2002 at 22:33 UTC | |
by WarrenBullockIII (Beadle) on Jun 05, 2002 at 22:39 UTC | |
by Aristotle (Chancellor) on Jun 06, 2002 at 00:59 UTC |