> Is the moral of this story "Don't use regexps unless nothing
> else will solve the problem?".
First, it even wasn't me who gave this idea - I met it twice in both
"Effective Perl Programming" and "Data Munging with Perl".
Second, the moral, I think, is "do whatever is good for your eyes but
t
On Tue, 12 Jun 2001, John Fox <[EMAIL PROTECTED]> wrote,
> Evgeny,
>
> Verily, on Wednesday June 13, 2001, the Sainted Evgeny Goldin (aka Genie) spake:
> > Don't try to push regexes whenever you can - eq, index, substr
> > may do a lot for you.
>
> Is the moral of this story "Don't use regexps un
Evgeny,
Verily, on Wednesday June 13, 2001, the Sainted Evgeny Goldin (aka Genie) spake:
> Don't try to push regexes whenever you can - eq, index, substr
> may do a lot for you.
Is the moral of this story "Don't use regexps unless nothing
else will solve the problem?".
John
--
> if ($ans =~ /^y$/i)
Other people pointed the "if ( lc($ans) eq 'y' )" solution
and it should go _much_ faster then using a regex ..
Don't try to push regexes whenever you can - eq, index, substr
may do a lot for you.
From: John Pimentel [mailto:[EMAIL PROTECTED]]
> I am wanting to reduce an "if" from this "or" I list below to "if ($ans eq
> "y")..." by forcing the response to a lower case "y" (like tolower, in C).
> The book I have does show the \l to force the next character to be
> lowercase, but I am stil
- Original Message -
From: John Pimentel <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, June 12, 2001 1:13 PM
Subject: converting standard input to an upper or lower case
> Hello all:
>
> I am wanting to reduce an "if" from this "o
uc($myvar) => upper case
lc($myvar) => lower case
For your example:
if (uc($ans) eq "Y")
John Pimentel wrote:
>
> Hello all:
>
> I am wanting to reduce an "if" from this "or" I list below to "if ($ans eq
> "y")..." by forcing the response to a lower case "y" (like tolower, in C).
> The book I
Hello all:
I am wanting to reduce an "if" from this "or" I list below to "if ($ans eq
"y")..." by forcing the response to a lower case "y" (like tolower, in C).
The book I have does show the \l to force the next character to be
lowercase, but I am still not clear how I pass (in this case a user
r