Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
How to get branch name in customized PERL-package?
meikel
HI,
i've build a PERL-package (customer.pm) which is used in a bunch of templates and scripts.
Now I have the problem, that I have to recognize the used branch ( i.e. of a template) in that package and do some different things (depending on the branch's name)
In scripts I can use $cgi->{form}{branch_name}. But this doesn't work in the package.
Is there a way to get the branch's name in my own customized perl-package?
And how?
Regards meikel
Find more posts tagged with
Comments
laj1
In scripts I can use $cgi->{form}{branch_name}. But this doesn't work in the package.
Is there a way to get the branch's name in my own customized perl-package?
And how?
Well, consider this. Your package declares, and operates inside its own namespace, likely "Cusomer".
Your main script, operates in a namespace called MAIN. If you want you package to have access to variables in the
MAIN namespace, you either need to pass them into your package's functions/methods, or have your package fully qualify
its variable references.
So if your main has a variable $cgi, your package has to reference it as $MAIN::cgi, but you are probably better off
passing the $cgi variable into the Customer package.
Are you getting any error messages? If so, they'd be helpful.
Len.
Len Jaffe
My Heart Is A Flower
Update your DevNet profile - let us know who you are!