L
Louis
Hope somebody can tell me why this happens to filehandles...
I am playing with perl packages, and I had all functions in one file.
Now I want to split them into different files using package.
BEFORE: I have a function that opens a filehandle (FH1) and then calls
another function to print messages. This works good.
NOW: I put the calling function in another file. When it calls the print
function it uses &main:
rtmess();, perl prints out errors: printf() Non
unopened filehandle FH1 at.....
ANd if I copy the prtmess() function in the same file as the calling
function, it works again.
My question is: I read somewhere that once you open a filehandle, perl
keeps it open until you close it. So why the different file scenario
doesn't seem to work?
Appreciate the help. Thanks.
I am playing with perl packages, and I had all functions in one file.
Now I want to split them into different files using package.
BEFORE: I have a function that opens a filehandle (FH1) and then calls
another function to print messages. This works good.
NOW: I put the calling function in another file. When it calls the print
function it uses &main:
unopened filehandle FH1 at.....
ANd if I copy the prtmess() function in the same file as the calling
function, it works again.
My question is: I read somewhere that once you open a filehandle, perl
keeps it open until you close it. So why the different file scenario
doesn't seem to work?
Appreciate the help. Thanks.