James Edward Gray II wrote:
>
> I would like to add some code to a sub that only needs to be run
> the first time the sub executes, or before is fine. If I add an
> INIT { } block at the beginning of the sub, would that do it?
>
> Are there other ways?
Nobody seems to be encouraging you to go f
James Edward Gray II wrote:
> I would like to add some code to a sub that only needs to be run the
> first time the sub executes, or before is fine. If I add an INIT { }
INIT{} won't do it.
> block at the beginning of the sub, would that do it? Are there other
> ways? Thanks.
yes. maintainin
Hi,
James Edward Gray II [mailto:[EMAIL PROTECTED] asked:
> I would like to add some code to a sub that only needs to be run the
> first time the sub executes, or before is fine. If I add an INIT { }
> block at the beginning of the sub, would that do it? Are there other
> ways? Thanks.
If yo
James Edward Gray II <[EMAIL PROTECTED]> wrote:
:
: I would like to add some code to a sub that only needs to
: be run the first time the sub executes, or before is fine.
: If I add an INIT { } block at the beginning of the sub,
: would that do it?
No. Not in a subroutine.
: Are there other
> "James" == James Edward Gray <[EMAIL PROTECTED]> writes:
James> I would like to add some code to a sub that only needs to be run the
James> first time the sub executes, or before is fine. If I add an INIT { }
James> block at the beginning of the sub, would that do it? Are there other
James
My $firstrun;
Sub mysub {
unless ($firstrun) {
init statements
$firstrun = 1;
}
That should do the trick. Not sure if there is a better way.
-Original Message-
From: James Edward Gray II [mailto:[EMAIL PROTECTED]
Sent: Wednesday, September