FW: Local scope for file handles?

Hancock Jr, Denis C. HancockDC at missouri.edu
Wed May 10 16:55:09 CDT 2000


It appears that the Major Domo at Perl Mongers does not like to see certain
words in messages.  I guess that "sub" is one such word.  The code example
should have the "#" at the beginning of each line removed.

-----------------------------------------
Denis C. Hancock , Jr.          Sr. Scientific Programmer/Analyst
213 Curtis Hall                       573-882-1722 (voice)
UMC-Agronomy                   573-884-7850 (fax)
Columbia MO 65211              HancockDC at missouri.edu
<mailto:HancockDC at missouri.edu> 


-----Original Message-----
From: Hancock Jr, Denis C. 
Sent: Wednesday, May 10, 2000 4:33 PM
To: Jorgensen, Erik ( IATS )
Subject: RE: Local scope for file handles?


Here is an example for creating local file handles from the Camel Book, page
51:

#sub newopen {
#	my $path = shift;
#	local *FH; # not my!
#	open (FH, $path) || return undef;
#	return *FH;
#}
#$fh = newopen('/etc/passwd');

-----------------------------------------
Denis C. Hancock , Jr.          Sr. Scientific Programmer/Analyst
213 Curtis Hall                       573-882-1722 (voice)
UMC-Agronomy                   573-884-7850 (fax)
Columbia MO 65211              HancockDC at missouri.edu
<mailto:HancockDC at missouri.edu> 


 > -----Original Message-----
 > From: Jorgensen, Erik ( IATS ) [mailto:jorgie at missouri.edu]
 > Sent: Wednesday, May 10, 2000 4:25 PM
 > To: 'columbia-pm-list at hfb.pm.org'
 > Subject: Local scope for file handles?
 > 
 > 
 > Hey folks!
 > 
 > Is there to locally scope file handles?
 > 
 > I use:
 > 
 > 	my $this = 'that';
 > 
 > all the time, so I tried:
 > 
 > 	my FILEHANDEL;
 > 
 > But it just generates an error.
 > 
 > Help! :)
 > 
 > Erik
 > 
 > -- 
 > Erik Jorgensen 
 > Programmer/Analyst - Principle
 > Customer Service and Support 
 > Information & Access Technology Services 
 > University of Missouri - Columbia 
 > (573) 882-5974 
 > www.missouri.edu/~ccjorgie 
 > jorgie at missouri.edu 
 > 



More information about the Columbia-pm mailing list