scoping file handles

D

dcruncher4

Aren't file handles global in scope?

So is there a way I can restrict the scope of a file handle to a
subroutine using my,
or any other suggested way. I am concerned about accidentally using the
same
file handle in different subroutines in a file and clobbering each
other.

TIA.
 
J

John W. Krahn

Aren't file handles global in scope?

Normal filehandles are package variables which are sort-of global.

So is there a way I can restrict the scope of a file handle to a
subroutine using my,

perldoc -q "How can I make a filehandle local to a subroutine"


John
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,201
Messages
2,571,049
Members
47,655
Latest member
eizareri

Latest Threads

Top