Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

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

by choroba (Chancellor)
on Oct 25, 2012 at 13:33 UTC ( #1000869=note: print w/replies, xml ) Need Help??


in reply to Re^4: 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?

The BEGIN must precede the use.
لսႽ ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

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

    Oh yeah, that sounds obvious now that you said it ^^"

    I'm getting an error (hopefully the last one)...

    Variable "$log_name" is not imported at ./script.pl line 53. Global symbol "$log_name" requires explicit package name at ./script.p +l line 53.
      OK:
      1. Declare the variable with our.
      2. In BEGIN, set its value.
      3. use the module.
      لսႽ ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

        And it's perfect !

        Thanks a lot choroba :)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1000869]
help
Chatterbox?
[Corion]: Nicholas Clark++ # read for a multichar block-delimiter by scanning for the last char, and only then check whether the whole delimiter was read.
[Corion]: At least if you're appending the data read to a larger buffer, this means you avoid the situation of "a delimiter was found but the other half has not been read yet"

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (10)
As of 2016-12-06 14:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (107 votes). Check out past polls.