-----Original Message----- From: Chas. Owens [mailto:[email protected]] Sent: Friday, May 29, 2009 10:22 AM To: sanket vaidya Cc: [email protected] Subject: Re: Range Operator Question
On Thu, May 28, 2009 at 23:49, sanket vaidya <[email protected]> wrote: snip > Can anyone write few simple codes explaining the behavior that Chas > mentioned, So that I can explore the codes for getting better picture? snip #!/usr/bin/perl >use strict; >use warnings; >use Data::Dumper; >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> my @a = 1 ... 10; print "normal flip flop behavior:\n", "the .. operator\n"; for my $n (@a) { if ($n == 3 .. $n == 6) { print "\t$n\n"; } } print "\nthe ... operator\n"; for my $n (@a) { if ($n == 3 ... $n == 6) { print "\t$n\n"; } } print "\nbehavior when the condition is true for both tests at the same time\n", "the .. operator\n"; for my $n (@a) { if ($n == 3 .. $n == 3) { print "\t$n\n"; } } print "\nthe ... operator\n"; for my $n (@a) { if ($n == 3 ... $n == 3) { print "\t$n\n"; } } -- Chas. Owens wonkden.net The most important skill a programmer can have is the ability to read. >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Got it & that's pretty interesting too. Thanks Chas Regards, Sanket Vaidya _____________________________________________________________________ This e-mail message may contain proprietary, confidential or legally privileged information for the sole use of the person or entity to whom this message was originally addressed. Any review, e-transmission dissemination or other use of or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. If you have received this e-mail in error kindly delete this e-mail from your records. If it appears that this mail has been forwarded to you without proper authority, please notify us immediately at [email protected] and delete this mail. _____________________________________________________________________ -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected] http://learn.perl.org/
