Do you know where your variables are? | |
PerlMonks |
Re: Modules of Formatsby shotgunefx (Parson) |
on Oct 01, 2002 at 10:12 UTC ( [id://201964]=note: print w/replies, xml ) | Need Help?? |
If you create a sub that would take a hash with '$var_in_format' => \$var_to_plug_in. Then you could change the formats to use references to values instead of the actual value. You could bind the args when importing or before using them. What I'm not sure about is the binding of vars within a format. I don't know if they are bound at declaration time to the package or if when they are used. Meaning that if a FORMAT in package Formats references $system and you alias the FORMAT into package main, when used, will it use $main::system or $Formats::system, I suspect the latter but I'm not sure. Should be easy enough to test. An example of a hand rolled import can be found here -Lee "To be civilized is to deny one's nature."
In Section
Seekers of Perl Wisdom
|
|