Re: Accepting default value for user input

2009-03-02 Thread Telemachus
On Mon Mar 02 2009 @ 7:54, Sarsamkar, Paryushan wrote: > Ohh ... sorry ... after rethinking over it ... I think it converts the > $normal to lower case before comparison Right, which is a standard and smart thing to do since you can't count on your users to correctly type 'y-e-s'. Damn users.

RE: Accepting default value for user input

2009-03-02 Thread Sarsamkar, Paryushan
@perl.org Cc: Gunnar Hjalmarsson Subject: RE: Accepting default value for user input Ok thanks. But is lc needed here? I tried without using lc it works fine because output of comparison will be always 1 if I am not wrong. last if lc $normal eq 'yes' or lc $normal eq 'no'

RE: Accepting default value for user input

2009-03-02 Thread Sarsamkar, Paryushan
...@gunnar.cc] Sent: Monday, March 02, 2009 5:44 PM To: beginners@perl.org Subject: Re: Accepting default value for user input Sarsamkar, Paryushan wrote: > I did not understand meaning of this line :( below. I only understood > that it will exit while loop if the input has either yes or no.

Re: Accepting default value for user input

2009-03-02 Thread Gunnar Hjalmarsson
Sarsamkar, Paryushan wrote: I did not understand meaning of this line :( below. I only understood that it will exit while loop if the input has either yes or no. But then what is " grep { lc $normal eq $_ } "? last if grep { lc $normal eq $_ } 'yes', 'no'; It's another way to say: last if

RE: Accepting default value for user input

2009-03-01 Thread Sarsamkar, Paryushan
Thanks all for your inputs. I did not understand meaning of this line :( below. I only understood that it will exit while loop if the input has either yes or no. But then what is " grep { lc $normal eq $_ } "? last if grep { lc $normal eq $_ } 'yes', 'no'; Thanks, Paryushan -Original Mess