in reply to Re: package variable does not persist
in thread package variable does not persist
One thing the use Module line does is check for params and dispatches subs based on them which eventually terminate the process.
If there are no params the use Module line does no dispatch and the script proceeds to set the package var and call a sub that sees it and all is well.
If there are params then nothing in the script happens after the use Module line, like setting the package variable, and that was the confusing part.
Since the use line is indeed hijacking my flow as AnomalousMonk noticed, haukex suggested setting the var in a BEGIN block, and now that I understand the problem it all makes sense and works as expected. Thank you monks!
|
|---|