Gossamer Forum
Home : General : Perl Programming :

File Handles

Quote Reply
File Handles
Is the following subroutine valid:

sub close_file {

my ($file_handle) = shift;
close $file_handle;
}

For example, say you open a file as follows:

open (FILE, ">>info.dat");

Is the following call valid to close the file:

&close_file (FILE);

Dan Smile
Quote Reply
Re: File Handles In reply to
Any takers?

Dan Smile
Quote Reply
Re: File Handles In reply to
Sorry, can't pass filehandle's like that. See:

http://language.perl.com/...ke_a_filehandle_loca

Cheers,

Alex