Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Modules of Formats

by shotgunefx (Parson)
on Oct 01, 2002 at 10:12 UTC ( [id://201964]=note: print w/replies, xml ) Need Help??


in reply to Modules of Formats

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."

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://201964]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (7)
As of 2024-04-23 16:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found