>
>i am beginer in Perl and have task in hand to do..i got to read lot of
>variables and parameters which are defined in one file. I have to use these
>variables in my perl script ..how do i do this...(how do i use the variables
>in one file in my perl script...)

HELLO,

Simply,you can declare all the variables in that file to be the package 
variable.For example,in the template.file,

template.file
----
our $header = '...';
our $footer = '...';
....


Then in the main script,you can get these variables' value by:

script.pl
----
require "/path/template.file";
our $header;
our $footer;

print $header;  # it should get the variable's value you defined in the 
template.file
print $footer;   # the same


The other way,you can define the codes in that file to be a package,then export 
the variables you needed.

Also about perl's variable scope,please read this article:
http://perl.plover.com/FAQs/Namespaces.html.en



--
Jeff Pang
NetEase AntiSpam Team
http://corp.netease.com

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to