Local scope for file handles?

Scott K. Laws scott at elvis.mu.org
Wed May 10 22:15:08 CDT 2000


The Filehandle module is probbly better than the way i suggested

Scott

On Wed, 10 May 2000, Jay Buffington wrote:

> You could use Typeglobs, but that's icky, (unless you're pre 5.0 - then
> you'll have to)
> 
> The best way to do it is through the FileHandle module.  i.e.:
> 
> #Use FileHandle;
> #
> #sub printfile($) {
> #        my $filename = shift;
> #        my $filehandle = FileHandle->new();
> #        open $filehandle, $filename or die "Can't open $filename";
> #
> #        while (<$filehandle>) { print; }
> #}
> 
> Hope this helps
> 
> Jay
> 




More information about the Columbia-pm mailing list