Ok, maybe I should restate the problem.  I have a bunch of scripts which
have a couple of lines that chuck some configuration stuff into some
variables.  I'm sick of editing the scripts each time the config changes.
I realise that I could use a modules and do stuff like:

$path = &Config::getPath();

Is there a better way of doing this?

Andrew Clark
90East (Asia Pacific) Pty Ltd
Canberra, Australia


02 6272 3700 (switch)
02 6272 3010 (facsimile)


[EMAIL PROTECTED]
www.90East.com


**********************************************************************
Notice: This e-mail may contain personal information as defined in the
Privacy Act 1988, or confidential information. Please do not disclose
personal information in this e-mail, other than that of the sender, to
another party without the consent of the sender. If you are not the
intended recipient, or believe that you have received this e-mail in error,
please do not print, copy, retransmit, disseminate, or otherwise use the
information. Also, please notify the sender that you have received this
e-mail in error, and delete the copy you received. Thank you.





                                                                                       
                    
                    bob ackerman                                                       
                    
                    <rdacker@pacb        To:     [EMAIL PROTECTED]                    
                    
                    ell.net>             cc:                                           
                    
                                         Subject:     Re: #include or similar          
                    
                    26/02/2002                                                         
                    
                    11:26                                                              
                    
                                                                                       
                    
                                                                                       
                    




i just went through this last week.
put a line at top of file to be included like;
package Util;

at end of file put:
1;

name the file Util.pm

to include it in another file say:
use Util;

assume a subroutine in included file called 'foo'.
to call it:
&Util::foo();

this is the simple version of a module. no bells.



On Monday, February 25, 2002, at 04:15  PM, [EMAIL PROTECTED] wrote:

> I'm looking for an equivalent to C's #include or shell's . in perl, and I
> can't find it.  Can anyone tell me how to include a second file at
runtime
> without writing a module?
>
> If writing a module is the only way to do it, can someone give a a very
> simple example of a module?
>
> Andrew Clark
> 90East (Asia Pacific) Pty Ltd
> Canberra, Australia
>
>
> 02 6272 3700 (switch)
> 02 6272 3010 (facsimile)
>
>
> [EMAIL PROTECTED]
> www.90East.com
>
>
> **********************************************************************
> Notice: This e-mail may contain personal information as defined in the
> Privacy Act 1988, or confidential information. Please do not disclose
> personal information in this e-mail, other than that of the sender, to
> another party without the consent of the sender. If you are not the
> intended recipient, or believe that you have received this e-mail in
> error,
> please do not print, copy, retransmit, disseminate, or otherwise use the
> information. Also, please notify the sender that you have received this
> e-mail in error, and delete the copy you received. Thank you.
>
>
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


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







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

Reply via email to