[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
- <!--x-content-type: text/plain -->
- <!--x-date: Tue Mar 2 14:42:26 2004 -->
- <!--x-from-r13: psbjyre ng bhgcbfgfragvary.pbz (Quevf Tbjyre) -->
- <!--x-message-id: 1078256453.23190.64.camel@devel -->
- <!--x-reference: [email protected] -->
- <!--x-reference: [email protected] -->
- <!--x-reference: 1078237547.23190.11.camel@devel -->
- <!--x-reference: [email protected] -->
- <!--x-reference: 1078238763.24210.20.camel@devel -->
- <!--x-reference: [email protected] --> "http://www.w3.org/TR/html4/loose.dtd">
- <!--x-subject: [ale] Perl Question -->
- <li><em>date</em>: Tue Mar 2 14:42:26 2004</li>
- <li><em>from</em>: cfowler at outpostsentinel.com (Chris Fowler)</li>
- <li><em>in-reply-to</em>: <<a href="msg00037.html">[email protected]</a>></li>
- <li><em>references</em>: <<a href="msg00022.html">[email protected]</a>> <<a href="msg00025.html">[email protected]</a>> <1078237547.23190.11.camel@devel> <<a href="msg00034.html">[email protected]</a>> <1078238763.24210.20.camel@devel> <<a href="msg00037.html">[email protected]</a>></li>
- <li><em>subject</em>: [ale] Perl Question</li>
On Tue, 2004-03-02 at 10:04, michael d. ivey wrote:
> On Tue, Mar 02, 2004 at 09:46:03AM -0500, Chris Fowler wrote:
> > Correct. I have many variables that are needed for the same scripts.
> > If one variable like email address is changed in the config file then I
> > want all scripts to use that new value.
>
> You want require:
>
> -------
> data.pl:
> $foo = "bar";
> $baz = "quux";
> -------
> program.pl:
> require "/path/to/data.pl";
> do_something_with($foo,$baz);
> -------
>
> require demands that a library file be included if it hasn't already
> been included. The file is included via the do-FILE mechanism, which is
> essentially just a variety of "eval".
>
> See 'perldoc -f require' for details.
>
> If you were doing OO perl, you'd just make a module that exported your
> constants, say MyApp::Constants, and then
> use MyApp::Constants;
> and they'd be exported into your namespace.
</pre>
<!--X-Body-of-Message-End-->
<!--X-MsgBody-End-->
<!--X-Follow-Ups-->
<hr>
<ul><li><strong>Follow-Ups</strong>:
<ul>
<li><strong><a name="00052" href="msg00052.html">[ale] Perl Question</a></strong>
<ul><li><em>From:</em> ivey at gweezlebur.com (michael d. ivey)</li></ul></li>
</ul></li></ul>
<!--X-Follow-Ups-End-->
<!--X-References-->
<ul><li><strong>References</strong>:
<ul>
<li><strong><a name="00022" href="msg00022.html">[ale] Perl Question</a></strong>
<ul><li><em>From:</em> bkruger at mindspring.com (Bob Kruger)</li></ul></li>
<li><strong><a name="00025" href="msg00025.html">[ale] Perl Question</a></strong>
<ul><li><em>From:</em> fletch at phydeaux.org (Fletch)</li></ul></li>
<li><strong><a name="00033" href="msg00033.html">[ale] Perl Question</a></strong>
<ul><li><em>From:</em> cfowler at outpostsentinel.com (Chris Fowler)</li></ul></li>
<li><strong><a name="00034" href="msg00034.html">[ale] Perl Question</a></strong>
<ul><li><em>From:</em> ivey at gweezlebur.com (michael d. ivey)</li></ul></li>
<li><strong><a name="00035" href="msg00035.html">[ale] Perl Question</a></strong>
<ul><li><em>From:</em> cfowler at outpostsentinel.com (Chris Fowler)</li></ul></li>
<li><strong><a name="00037" href="msg00037.html">[ale] Perl Question</a></strong>
<ul><li><em>From:</em> ivey at gweezlebur.com (michael d. ivey)</li></ul></li>
</ul></li></ul>
<!--X-References-End-->
<!--X-BotPNI-->
<ul>
<li>Prev by Date:
<strong><a href="msg00049.html">[ale] OT - ViewSoniic A90f+ Monitor</a></strong>
</li>
<li>Next by Date:
<strong><a href="msg00051.html">[ale] Two SSH access questions</a></strong>
</li>
<li>Previous by thread:
<strong><a href="msg00037.html">[ale] Perl Question</a></strong>
</li>
<li>Next by thread:
<strong><a href="msg00052.html">[ale] Perl Question</a></strong>
</li>
<li>Index(es):
<ul>
<li><a href="maillist.html#00050"><strong>Date</strong></a></li>
<li><a href="threads.html#00050"><strong>Thread</strong></a></li>
</ul>
</li>
</ul>
<!--X-BotPNI-End-->
<!--X-User-Footer-->
<!--X-User-Footer-End-->
</body>
</html>