Mark Goland wrote:
> 
> From: "John W. Krahn" <[EMAIL PROTECTED]>
> 
> > Mark Goland wrote:
> > >
> > > the way you did it, would need to use or operator
> > > $answer =~ m/Y|y|N|n/
> > > you probebly want to check if thats the only thing entred,
> > >
> > > $answer =~ m/^yn$/i
> > >
> > > ^ begins with, $ ends with, i is for case insensetive.
> >
> > That would work if the user entered the string "yn" (or "YN" or "Yn" or
> > "yN".)  It should be either:
> >
> > $answer =~ m/^(?:y|n)$/i;
> >
> > Or:
> >
> > $answer =~ m/^(?i:y|n)$/;
> >
> > Or:
> >
> > $answer =~ m/^[yn]$/i;
> 
> Whoops.....
> $answer =~ m/^y|n$/i

That means $answer starts with 'y' or ends with 'n'.


John
-- 
use Perl;
program
fulfillment

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to