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
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
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
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
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]
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
$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
> -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
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
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 =~ /^
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
11 matches
Mail list logo