On Tue, 2 Jan 2001, Alloun, Jonathan wrote:
>
> Hello,
>
> I have a parameter
>
> my $name0 = "c:/test";
>
> $name0 is used for opening a file throughout my program.
>
> I have used it more than once and therefore it says that $name0 masks
> ear
> "Alloun, Jonathan" wrote:
>
> Yes, I have fixed that problem but I am calling a set of different modules from
>within my Perl program. I am generating a log file and therefore have a filehandle
>that I opened initially.
>
> How do I make the file handle that I opened once in the Perl program
Title: RE: masks earlier declaration in same scope
Yes, I have fixed that problem but I am calling a set of different modules from within my Perl program. I am generating a log file and therefore have a filehandle that I opened initially.
How do I make the file handle that I opened
Jonathan,
The my declaration for a variable such as should appear only once in a given
scope. After you have declared it, you can then assign to that declared
variable as many times as you need.
my $name0 = "c:/test";
. . .
$name0 = "c:/file2";
. . .
$name0 = "c:/outp
ks,
>
>Jonathan
>>Hello,
>>I have a parameter
>>my $name0 = "c:/test";
>>$name0 is used for opening a file throughout my program.
>>I have used it more than once and therefore it says that $name0 masks
>>earlier declaration in same sc
Title: RE: masks earlier declaration in same scope
Chuck,
Thanks for your help but I probably did not make it clear that I chose to use the same name since I am appending to the same file.
Why I am having to open it many times, because I am calling different modules within the
>Hello,
>I have a parameter
>my $name0 = "c:/test";
>$name0 is used for opening a file throughout my program.
>I have used it more than once and therefore it says that $name0 masks
earlier declaration in same scope.
>I have tried to undef $name0 but it still get t
Title: Re: masks earlier declaration in same scope
Hello,
I have a parameter
my $name0 = "c:/test";
$name0 is used for opening a file throughout my program.
I have used it more than once and therefore it says that $name0 masks earlier declaration in