Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Include external variables into script

by mda2 (Hermit)
on May 24, 2005 at 14:15 UTC ( [id://459983]=note: print w/replies, xml ) Need Help??


in reply to Include external variables into script

You need explicit declare variables $var1 and $var2.
use warnings; use strict; our ( $var1, $var2 ) = ( 0, 0 ); printf "var1: %s\tvar2:%s\n", $var1, $var2; require "conf"; printf "var1: %s\tvar2:%s\n", $var1, $var2;
conf
$var1='x'; $var2='y';
But usage of Config modules is best and more explicit to do config.

I like from Config::Simple...
But many others config modules are available from CPAN.

See Writeup Formatting Tips... you don't need to put <br> into <code> sections.

--
Marco Antonio
Rio-PM

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (3)
As of 2024-04-25 07:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found