Re: converting standard input to an upper or lower case

2001-06-13 Thread Evgeny Goldin (aka Genie)
> 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

Re: converting standard input to an upper or lower case

2001-06-12 Thread Hasanuddin Tamir
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

Re: converting standard input to an upper or lower case

2001-06-12 Thread John Fox
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 --

Re: converting standard input to an upper or lower case

2001-06-12 Thread Evgeny Goldin (aka Genie)
> 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.

RE: converting standard input to an upper or lower case

2001-06-12 Thread Filip Sneppe \(Yucom\)
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

Re: converting standard input to an upper or lower case

2001-06-12 Thread Simon McCaughey
- 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

Re: converting standard input to an upper or lower case

2001-06-12 Thread Jean-Matthieu Guerin
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

converting standard input to an upper or lower case

2001-06-12 Thread John Pimentel
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