Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: How to access main package global vars in modules

by philipbailey (Chaplain)
on Jul 07, 2011 at 19:20 UTC ( #913246=note: print w/replies, xml ) Need Help??


in reply to How to access main package global vars in modules

There are several alternative one line changes that do what you ask, such as:

  • Declare $glbA and $glbB with our in functions.pl
  • Refer to those variables in functions.pl with the fully qualified $main::glbA and $main::glbB
  • no strict "vars"

But none of the above is recommended. You would be much better in most scenarios to make functions.pl a package, and pass lexical variables as parameters to its functions.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://913246]
help
Chatterbox?
thezip switches the jolokia powder with Folgers Crystals...
[Michael W]: So i can read ok from this how do i put data back inmy @Variables = ( $Map_Request_Date, $Map_Due_Date,$Map _Cutover_Date,$Map _Complete_Date,$Ma p_Approved_Date);

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (9)
As of 2017-04-27 15:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (509 votes). Check out past polls.