Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Re: Re: a simple include....

by crouchingpenguin (Priest)
on Apr 30, 2003 at 16:27 UTC ( [id://254365]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: a simple include....
in thread a simple include....

If you declare $SousMaintenance within prov.pl, like so:

#!/usr/bin/perl # prov.pl use strict; use warnings; use vars qw( $SousMaintenance ); require './inc.pl'; print $SousMaintenance,"\n";

with an inc.pl like:

$SousMaintenance = 'value one'; 1;

the problem goes away. Another idea for you is to include a package declaration within inc.pl so that you create a namespace (seperate from main::) like so:

# inc.pl package myInc; $SousMaintenance = 'value one';

Then call it like this within prov.pl:

print $myInc::SousMaintenance,"\n";

cp
----
"Never be afraid to try something new. Remember, amateurs built the ark. Professionals built the Titanic."

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (6)
As of 2024-03-29 01:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found