Ohh ... sorry ... after rethinking over it ... I think it converts the $normal to lower case before comparison
Please ignore my mail earlier Thanks, Paryushan -----Original Message----- From: Sarsamkar, Paryushan [mailto:[email protected]] Sent: Monday, March 02, 2009 6:18 PM To: [email protected] 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'; Thanks, Paryushan -----Original Message----- From: Gunnar Hjalmarsson [mailto:[email protected]] Sent: Monday, March 02, 2009 5:44 PM To: [email protected] 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. But > then what is " grep { lc $normal eq $_ } "? > > last if grep { lc $normal eq $_ } 'yes', 'no'; It's another way to say: last if lc $normal eq 'yes' or lc $normal eq 'no'; http://perldoc.perl.org/functions/grep.html -- Gunnar Hjalmarsson Email: http://www.gunnar.cc/cgi-bin/contact.pl -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected] http://learn.perl.org/
