On 3/6/07, Beginner <[EMAIL PROTECTED]> wrote:
On 6 Mar 2007 at 6:08, Jeff Pang wrote:
snip
> $ cat test.pl
> use strict;
> our ($path1,$path2);
> require "param.pl";
> print("path1 $path1\n");
> print("path2 $path2\n");
>
> $ cat param.pl
> #!/usr/bin/perl
> use strict;
> my $basepath = "/var/
Beginner wrote:
>
On 6 Mar 2007 at 6:08, Jeff Pang wrote:
Is it possible to send an variable (through the env or as an
argument, or ) so I can use the variable $dir from the module
test.pl to set the variable $vardir in param.pl. ??
Yes you can.
You may declare the vars wanted to be sh
>
>Is the 1; required here? I thought it was only needed in packages. Am
>I mistaken?
>
Yes,'1' is needed.When you requie a file in a perl script but that file return
a false value,the 'require' should get failed.It would report the errors like:
param.pl did not return a true value at test.pl
On 6 Mar 2007 at 6:08, Jeff Pang wrote:
> Is it possible to send an variable (through the env or as an
> >argument, or ) so I can use the variable $dir from the module
> >test.pl to set the variable $vardir in param.pl. ??
> >
>
> Yes you can.
> You may declare the vars wanted to be shared
Is it possible to send an variable (through the env or as an
>argument, or ) so I can use the variable $dir from the module
>test.pl to set the variable $vardir in param.pl. ??
>
Yes you can.
You may declare the vars wanted to be shared in the module as package variable
using Perl's "our"
Hi,
Hi,
I want to set pathnames in a centralised module (called with use or
require). Is it possible to send an variable (through the env or as an
argument, or ) so I can use the variable $dir from the module
test.pl to set the variable $vardir in param.pl. ??
Any help greatly appreciat