in reply to require without the exec

May be i'm wrong but, if you put '1;' as the last line in a perl module you prevent it from being executed?

Replies are listed 'Best First'.
Re: Re: require without the exec
by little (Curate) on May 23, 2003 at 17:43 UTC

    ... You probably are.
    See require for the why ...
    The file must return true as the last statement to indicate successful execution of any initialization code, so it's customary to end such a file with 1; unless you're sure it'll return true otherwise. But it's better just to put the 1;, in case you add more statements.

    Have a nice day
    All decision is left to your taste