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
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";}
> >}
> > }
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
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
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+/,
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