develooper Front page | perl.perl6.language | Postings from August 2000

Re: Things to remove

From:
Bart Lateur
Date:
August 23, 2000 16:49
Subject:
Re: Things to remove
Message ID:
ggo8qs4027mbl60i5bqfem4g9mbrk459mn@4ax.com
On Wed, 23 Aug 2000 17:24:23 -0600 (MDT), Nathan Torkington wrote:

>Compile the main() program code into a subroutine called 0, and you're
>off!
>
>  &0  anyone? :-)
>
>(that's digit 0, by analogy to $0)

What would be nice about this, is that then you could use "return" in a
script to stop execution. I don't like "exit", because you can't trap
it, if ever you wrap the code in another script.

	open OUT, ">do.pl";
	print OUT "exit\n";
	close OUT;
	print "before\n";
	do "do.pl";
	print "after\n";


Or, "die" should have a way of stopping the program without a warning
message.

-- 
	Bart.



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About