Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

This node falls below the community's threshold of quality. You may see it by logging in.

Replies are listed 'Best First'.
Re: make a required script exit script
by Roy Johnson (Monsignor) on Feb 09, 2006 at 16:45 UTC
    When I require a file that calls exit, the whole program stops, just like I expected. Have you tried that?

    Caution: Contents may have been coded under pressure.
Re: make a required script exit script
by swkronenfeld (Hermit) on Feb 09, 2006 at 16:48 UTC
    Have you tried exiting in the required script?

    test.pl
    #!/usr/bin/perl -w use strict; require "test2.pl"; print "Shouldn't ever print me!\n";


    test2.pl
    #!/usr/bin/perl -w use strict; print "In required\n"; exit;


    Test it
    > ./test.pl In required >
Re: make a required script exit script
by Fletch (Bishop) on Feb 09, 2006 at 16:46 UTC

    What happened when you tried calling exit in the required code?