Re: Allow user to input data until user press a certain key

2007-10-21 Thread Dr.Ruud
newBee schreef: > print "Please enter term: \n"; > while(chomp($userInput = )) { > last if(/^q$/i); > @lineArray = split '\W+', $userInput; > foreach $word(@lineArray){ > if($DEBUG){print "<$word>\n";} > } > } You (1) forget to check defined (which is implicit with "while

Re: Allow user to input data until user press a certain key

2007-10-21 Thread newBee
On Oct 21, 4:08 am, [EMAIL PROTECTED] (Jeremy Kister) wrote: > On 10/21/2007 1:05 AM, newBee wrote: > > > $userInput = ; > > while(chomp($userInput) ne /q/i) { > >@lineArray = split '\W+', $userInput; > >foreach $word(@lineArray){ > >if($DEBUG){print "<$word>\n";} > >} > > }

Re: Allow user to input data until user press a certain key

2007-10-21 Thread Tom Phoenix
On 10/20/07, newBee <[EMAIL PROTECTED]> wrote: > Can someone tell me how to allow user to keep enter data until the > user hit certain key such as /q/i That is, if the user types ABCDEQ, your code should contnue with the value "ABCDE"? You might be able to do that on some systems, if you use ver

Allow user to input data until user press a certain key

2007-10-21 Thread newBee
Can someone tell me how to allow user to keep enter data until the user hit certain key such as /q/i i was thinking something like this print "enter data\n"; $userInput = ; while(chomp($userInput) ne /q/i ) { #bla bla bla } Thanks in advance... -- To unsubscribe, e-mail: [EMAIL PROTECT

Re: Allow user to input data until user press a certain key

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

Allow user to input data until user press a certain key

2007-10-21 Thread newBee
Sorry my previous entry I didn't have much information, What i want to do is, allow the user to input word until the user enter a certain key to end the standard input. I am not sure how to do this in perl... may be i am not using regex correctly... or may be i am not handling the control structu