[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] Die program die!



At 09:53 -0500 23.07.97, Mark Manning/Muniz Eng. wrote:
>Just a short note on an interesting way to kill a system.
>:-)

Interesting? Recursion without a terminating condition isn't interesting,
it's what you should have learned _not_ to do years ago ;-)

>#!perl
>	die system("try");

You can shorten that to

	die system $0;

>Ok - so why do this?

Good question ;-)

> I was just playing around with the
>die command to see what all it would do before the process
>died off.  Actually, the system died off.  :-(

Bad system. I would expect you to reach the limit of the number of
simultaneous user processes allowed for your account rather fast and then
those processes should die. It definitely shouldn't bring down a Unix
system as long as you don't run the program as root.

As to your question what will happen on a Macintosh: Mac's don't fork and
exit on system (at least I suspect that Mattias' didn't implement it that
way ;-) and Macperl on my Powerbook 3400c simply enters a tight loop and
outputs random chars to the Macperl console window (maybe due to a stack
overflow?)

	--jc

--
Ju:rgen Christoffel, GMD - Forschungszentrum Informationstechnik GmbH
E-Mail: christoffel@gmd.de or one of {ftp,news,web}master@gmd.de



***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch