On Tue, 21 Jan 2003 11:06:55 -0500, [EMAIL PROTECTED] (Paul Kraus)
wrote:

>Great article. Cleared up all of my confusion. However it did not touch
>on "our". Anyone care to explain what its used for. 

For a practical example:
The only time I ever needed to use "our" is when I use
the "require script" method as a means of importing
some configuration variables.

Say I have a bunch of scripts which all share the
same configuration variables. I create a single
script "my_config" with all the variables defined in
it.
Like this:
########################################################
#my_config
$customer_directory = 'customers';
$server_address = 'zentara.zentara.net/~zentara'; #basename only
$secure_server_address  = 'https://zentara.zentara.net/~zentara';
$cgi_directory = '/cgi-bin/store'; #relative to html docs dir
$imagedir= '/home/zentara/public_html/store/images';
#######################################################


Then in all the other scripts I do this:
##########################################################
our($customer_directory,$server_address,$secure_server_address,
       $cgi_directory,$imagedir);

require ./my_config;
#############################################################

      



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to