TCLUG Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [TCLUG:12524] Perl loop question





> -----Original Message-----
> From: Schlough, Mark [mailto:Mark.Schlough@nmb.norwest.com]
> Sent: Tuesday, January 18, 2000 2:48 PM
> To: 'tclug-list@mn-linux.org'
> Subject: [TCLUG:12524] Perl loop question
>
>
> Hi,
>
> I'm writing perl program that needs to run continuously. Does
> anyone have a
> suggestion of what kind of looping mechanism I should use?
> Also, I'd like to know if there are any preferred ways to break the loop.
>
> Thanks 10^6
>
> Mark
>
> Life is complex.. it has both real and imaginary parts.
>

  I see there's already been lots of good answers to this, but thought I'd
mention that

	for (;;) {
		do_stuff
	}

	is also often used as an infinite loop.  I tend to use that since it's
easier (for me) to spot in big blobs of uncommented code such as I am prone
to compose.

	You can break out of "for" loops with "last" the same as with "while".


--
Eric Hillman
UNIX Sysadmin
City & County Credit Union
ehillman@cccu.com