List Info

Thread: How come this for loop makes an infinite loop?




How come this for loop makes an infinite loop?
user name
2006-12-21 17:30:05
The condition for loop termintion $loop != $input will
happen only if a positive integer is entered as
$input.

--- lord_vodka_ccccccxxxxxxvi
<lord_vodka_ccccccxxxxxxviyahoo.com> wrote:

> 
> print "Input ";
> $input = <STDIN>;
> chomp($input);
> print newline; print newline;
> TONE_ROW = (1,2,3,4,5,6,7,8,9,10,11,12);
> print TONE_ROW;
> print newline; print newline;
> print newline; print newline;
> 
> for($loop = 0; $loop != $input, $loop = $loop + 1; )
> 		{
> 		print "TONE_ROWnn";
> 		push(TONE_ROW, shift(TONE_ROW));
> 		}
> 
> 


Send free SMS to your Friends on Mobile from your Yahoo!
Messenger. Download Now! http://messen
ger.yahoo.com/download.php


Unsubscribing info is here: h
ttp://help.yahoo.com/help/us/groups/groups-32.html 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://g
roups.yahoo.com/group/perl-beginner/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http
://groups.yahoo.com/group/perl-beginner/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:perl-beginner-digest@yahoogroups.com 
    mailto:perl-beginner-fullfeatured@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
    perl-beginner-unsubscribe@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.c
om/info/terms/
 
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )