Re: One Time Only Code in Sub

2003-09-25 Thread Rob Dixon
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

Re: One Time Only Code in Sub

2003-09-24 Thread david
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

RE: One Time Only Code in Sub

2003-09-24 Thread Thomas Bätzler
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

RE: One Time Only Code in Sub

2003-09-24 Thread Charles K. Clarkson
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

Re: One Time Only Code in Sub

2003-09-24 Thread Randal L. Schwartz
> "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

RE: One Time Only Code in Sub

2003-09-24 Thread Paul Kraus
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