On 10/21/2007 1:05 AM, newBee wrote:
$userInput = <STDIN>;
while(chomp($userInput) ne /q/i) {
        @lineArray = split '\W+', $userInput;
        foreach $word(@lineArray){
                if($DEBUG){print "<$word>\n";}
        }
}

while(<STDIN>){
  chomp;
  last if(/q/i);
  foreach my $word (split(/\W+/, $_)){
    print "<$word>\n" if($DEBUG);
  }
}

also, you probably mean /^q$/i in that first regex, otherwise you're matching any letter q -- quick, squid, etc

--

Jeremy Kister
http://jeremy.kister.net./

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to