Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^3: Can I from within a module access variables from the calling program?

by perl_walker (Novice)
on Oct 25, 2012 at 12:32 UTC ( #1000848=note: print w/replies, xml ) Need Help??


in reply to Re^2: Can I from within a module access variables from the calling program?
in thread Can I from within a module access variables from the calling program?

Hi HJO,

Try this, In your module declare global variable, then export variable

.... our %glo_var = ('a'=>100,'b'=>200); ... @EXPORT = qw(%glo_var ... members); ... 1;

In your tool

use SampleModule::TestMod; print $glo_var{'a'};exit;

Output=100

Replies are listed 'Best First'.
Re^4: Can I from within a module access variables from the calling program?
by HJO (Acolyte) on Oct 25, 2012 at 12:49 UTC

    Hi perl_walker

    it appears to me that I wasn't enought specific on my post be cause what I'm trying to do is precisely the opposite, calling a variable FROM the principal script INTO the module

    But thanks anyway :)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1000848]
help
Chatterbox?
[james28909]: what i am trying to accomplish is piping the output of ffmpeg to yet another encryption routine using libsodium. and hopefully once that is done i will be able to forward the packets to discord servers
[RonW]: choroba: Please define "high end" and "low end"
[LanX]: choroba: subversive (as usual ;)
[james28909]: i dunno, if i didnt have so little experience in linux i would swap. but it would be to much of a learning curve for me right now.
[choroba]: Low-end is defined as the Perl that generates millions of income
[choroba]: sorry, that's high-end, of coursse
[choroba]: low end, in my talk, will be code that "we don't touch because it works" and noone knows why
[choroba]: I want to present the most bizzare bugs and misfeatures I met when working for a large financial institution
[choroba]: I already gave a similar talk to my friends in a pub and at an internal conference at work and people liked it, so maybe...
[choroba]: LanX: That's the heritage, I can't do anything else

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (17)
As of 2017-05-22 21:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?