Re: Incrementing letters in for loop

2010-04-15 Thread C.DeRykus
On Apr 14, 5:22 am, shawnhco...@gmail.com (Shawn H Corey) wrote: C.DeRykus wrote: And, here's the doozy for me as I tried remembering:       If the final value specified is not in the sequence that the       magical increment would produce, the sequence continues       until the next

Re: Incrementing letters in for loop

2010-04-14 Thread Shawn H Corey
C.DeRykus wrote: And, here's the doozy for me as I tried remembering: If the final value specified is not in the sequence that the magical increment would produce, the sequence continues until the next value is longer than the final value specified.

Re: Incrementing letters in for loop

2010-04-13 Thread Owen
. As shown by the third for loop, incrementing the letters, seems to give me the desired output in each loop. What is going on here? #!/usr/bin/perl use warnings; use strict; my $letter = u; for (u..z){ print $_ ; } print \n\n; for ($_=u; $_ le z; $_++){ print

Re: Incrementing letters in for loop

2010-04-13 Thread Shlomi Fish
by the third for loop, incrementing the letters, seems to give me the desired output in each loop. What is going on here? #!/usr/bin/perl use warnings; use strict; my $letter = u; for (u..z){ print $_ ; } print \n\n; for ($_=u; $_ le z; $_++){ print $_ ; } le

Re: Incrementing letters in for loop

2010-04-13 Thread Magne Sandøy
as expected. As shown by the third for loop, incrementing the letters, seems to give me the desired output in each loop. What is going on here? #!/usr/bin/perl use warnings; use strict; my $letter = u; for (u..z){ print $_ ; } print \n\n; for ($_=u; $_ le z; $_++){ print $_ ; } le

Re: Incrementing letters in for loop

2010-04-13 Thread Shlomi Fish
way passed what I expected, and actually stops at yz and not z as expected. As shown by the third for loop, incrementing the letters, seems to give me the desired output in each loop. What is going on here? #!/usr/bin/perl use warnings; use strict; my $letter = u

Re: Incrementing letters in for loop

2010-04-13 Thread Magne Sandøy
for loop actually counts way passed what I expected, and actually stops at yz and not z as expected. As shown by the third for loop, incrementing the letters, seems to give me the desired output in each loop. What is going on here? #!/usr/bin/perl use warnings; use strict; my $letter = u; for (u

Re: Incrementing letters in for loop

2010-04-13 Thread Shlomi Fish
On Tuesday 13 Apr 2010 11:17:12 Magne Sandøy wrote: [SNIP] Hi again. Does this mean this is a bug? It's not a bug - this is how it works. My point is to get z at the end. Using eq or lt wont work. You need to evaluate the condition at the end of the loop instead of at the beginning. Try

Re: Incrementing letters in for loop

2010-04-13 Thread Shawn H Corey
as expected. As shown by the third for loop, incrementing the letters, seems to give me the desired output in each loop. What is going on here? #!/usr/bin/perl use warnings; use strict; my $letter = u; for (u..z){ print $_ ; } print \n\n; for ($_=u; $_ le z; $_++){ print

Re: Incrementing letters in for loop

2010-04-13 Thread C.DeRykus
by the third for loop, incrementing the letters, seems to give me the desired output in each loop. What is going on here? #!/usr/bin/perl use warnings; use strict; my $letter = u; for (u..z){     print $_ ; } print \n\n; for ($_=u; $_ le z; $_++){     print $_ ; } print \n\n; for(1

Re: Incrementing letters in for loop

2010-04-13 Thread Shawn H Corey
C.DeRykus wrote: Clear as mud? Did you say 'Hell, no'...? Go then and meditate on autoincrement magic, grasshopper. When enlightenment comes, please report back and explain it to us too... Actually, it is because string-comparison operators order strings differently than auto-increment.

Re: Incrementing letters in for loop

2010-04-13 Thread Magne Sandøy
at yz and not z as expected. As shown by the third for loop, incrementing the letters, seems to give me the desired output in each loop. What is going on here? #!/usr/bin/perl use warnings; use strict; my $letter = u; for (u..z){ print $_ ; } print \n\n; for ($_=u; $_ le z; $_++){ print

Re: Incrementing letters in for loop

2010-04-13 Thread Brandon McCaig
2010/4/13 Magne Sandøy msan...@gmail.com: Thanks for all the good info. I think I have a grasp on incrementing and comparison, but now, what puzzles me, is the fact that when I use le less than or equal, why does it actually increment the z? It is by then passed the less than, and already at

Re: Incrementing letters in for loop

2010-04-13 Thread C.DeRykus
On Apr 13, 8:54 am, shawnhco...@gmail.com (Shawn H Corey) wrote: C.DeRykus wrote: Clear as mud?  Did you say 'Hell, no'...?  Go then and meditate on  autoincrement magic,  grasshopper. When enlightenment comes, please report back and  explain it to us too... Actually, it is because

Incrementing letters in for loop

2010-04-12 Thread Magne Sandøy
Hi. I'm new to perl, and I stumbled across a strange behavior in my for loop. In the following code, the second for loop actually counts way passed what I expected, and actually stops at yz and not z as expected. As shown by the third for loop, incrementing the letters, seems to give me