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 24, 2003 11:55 AM
To: [EMAIL PROTECTED]
Subject: One Time Only Code in Sub


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.

James


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to