Re: Comparing to many possibles

2002-03-04 Thread Dennis G. Wicks
Greetings All; Thanks for all the great suggestions! They all worked as written and now I can go onto the next problem. What ever that turns out to be! And to answer a couple of questions; >}On Mar 4, 12:36, Luke Bakken wrote: >} Subject: Re: Comparing to many possibles >Why do

RE: Comparing to many possibles

2002-03-04 Thread Timothy Johnson
Okay, that makes a little more sense. -Original Message- From: Jeff 'japhy' Pinyan [mailto:[EMAIL PROTECTED]] Sent: Monday, March 04, 2002 1:31 PM To: Timothy Johnson Cc: [EMAIL PROTECTED] Subject: RE: Comparing to many possibles On Mar 4, Timothy Johnson said: > I

RE: Comparing to many possibles

2002-03-04 Thread Jeff 'japhy' Pinyan
On Mar 4, Timothy Johnson said: > I still am not convinced that all of the hoopla about \z is really >necessary. I guess the question I need answered before I go back and change >anything is this: How is the user supposed to enter an extra \n without >exiting the prompt? What I mean is, the o

RE: Comparing to many possibles

2002-03-04 Thread Timothy Johnson
7;t heard any really good arguments on this. -Original Message- From: Jeff 'japhy' Pinyan [mailto:[EMAIL PROTECTED]] Sent: Monday, March 04, 2002 1:07 PM To: Dennis G. Wicks Cc: [EMAIL PROTECTED] Subject: Re: Comparing to many possibles On Mar 4, Dennis G. Wicks said: >Is there

Re: Comparing to many possibles

2002-03-04 Thread William.Ampeh
I prefer this $x =~ /^[x-z]$/i; Normally, I will use: my $ans = ( $x =~ /^[x-z]$/i )?"yes":"no"; print "\n\nThe answer = $ans\n"; __ William Ampeh (x3939) Federal Reserve Board -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Comparing to many possibles

2002-03-04 Thread Jeff 'japhy' Pinyan
On Mar 4, Dennis G. Wicks said: >Is there some perl shorthand that will make it easier to say > > if ( $x eq 'X' || $x eq 'Y' || $x eq 'Z' ) You can use if ($x =~ /^(?:X|Y|Z)\z/) { ... } I side with Randal in warning about the use of $ here where \z is clearly the proper choice. -- J

Re: Comparing to many possibles

2002-03-04 Thread bob ackerman
$x='y'; if($x=~/[xyz]/) # checks for match to any character in set { print 'yes'; } else { print 'no'; } On Monday, March 4, 2002, at 11:33 AM, Dennis G. Wicks wrote: > Greetings; > > Is there some perl shorthand that will make it easier to say > > if ( $x eq 'X' || $x

RE: Comparing to many possibles

2002-03-04 Thread Jason Larson
> -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] > Subject: Comparing to many possibles > > Greetings; > > Is there some perl shorthand that will make it easier to say > > if ( $x eq 'X' || $x eq 'Y' || $x eq 'Z' ) > This should do what you want: if

RE: Comparing to many possibles

2002-03-04 Thread Timothy Johnson
You can do it with a regex: if($x =~ /^[XYZ]$/){ do something... } or if($x =~ /^(X|Y|Z)$/){ do something... } -Original Message- From: Dennis G. Wicks [mailto:[EMAIL PROTECTED]] Sent: Monday, March 04, 2002 11:34 AM To: [EMAIL PROTECTED] Subject: Comparing to many possibles

RE: Comparing to many possibles

2002-03-04 Thread Wagner-David
Could use a regex: if ( $x =~ /[XYZ]/ ) { # if contains }else # if doesn't contain } If there can be more than one character (like ' ABX') then you would need to add: $x =~ /^

RE: Comparing to many possibles

2002-03-04 Thread Nikola Janceski
if ( $x =~ /^(X|Y|Z)$/ ) # anyone got better? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Monday, March 04, 2002 2:34 PM To: [EMAIL PROTECTED] Subject: Comparing to many possibles Greetings; Is there some perl shorthand that will make it easier to say