Dear EmbPerl veterans,
I'm trying to incorporate EmbPerl into a web-based greeting card program, and I would like allow card designers to have access to about 25+ variables from the main script in their HTML templates.
Your simplest solution might be to simply stuff the variables into an external package. But you'd want to make them read-only presumably, so maybe a method would be best.
So you could pass in the "param" variable a pointer to an object, and then they could call that.
$_[0]->myvar1() $_[0]->myvar2()
Or even $[0]_->var('name of var')
If you're using EmbperlObject you can get the same kind of effect by making their fields a child of a parent object that has those methods.
Unfortunately there's not a good way to automatically get a "$this" or "$self" variable. Unless you tell them to start their code with something like:
[$ var $this $][- $this = shift -]
Which is in fact how I start all of my EmbperlObject files.
I'm afraid I'm not being terribly clear. It's been a long day. But if nobody else does a better job of explaining let me know and I'll dig up some examples.
--
Kee Hinckley
http://www.puremessaging.com/ Junk-Free Email Filtering
http://commons.somewhere.com/buzz/ Writings on Technology and Society
I'm not sure which upsets me more: that people are so unwilling to accept responsibility for their own actions, or that they are so eager to regulate everyone else's.
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]