in reply to Where to put long BEGIN blocks used by many programs...

Make it a module. use will automatically run the code at compilation time. You can even leave out the explicit BEGIN block.

Also, pull those use clauses out of your function. use is unconditionally executed at compile time, so putting them in there is just misleading.

PS.: please take the time to learn about PerlMonks linking syntax and use it. Since I read PM using www.perlmonks.org, my cookie is set for that host, so following your link sends me to a page where I'm not logged in. As a bonus, using [id://420722] would have inserted the title of your thread into the text automagically.

Makeshifts last the longest.

Replies are listed 'Best First'.
Re^2: Where to put long BEGIN blocks used by many programs...
by argv (Pilgrim) on Jan 11, 2005 at 06:01 UTC
    right on all counts. thanks.

    As for the linking syntax... I was curious how others had done it, so I looked it up and found out... but it was after I already posted. I was going to update my posting with the new link sytnax, but then got sidetracked by the fact that "update" doesn't give a "preview" button like normal posting does... so, I hesitated (cuz I didn't want to make a mistake, and I wanted to actually see it work), so I opted to ask folks in the chatterbox why there was no Preview button... this started a discussion that had me forgetting what I was going in the first place.

    sigh...