>>>>>>>>>>>>>>> Code >>>>>>>>>>>
my $FH = returnFileHandle();
print $FH "Hello, World";
sub returnFileHandle {
my $fileName = "file.txt";
open (FILEHANDLE, ">$fileName") or die $!;
return \*FILEHANDLE;
}
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
The subroutine returnFileHandle() returns file handle (in overwrite mode) of file "file.txt".
Search for Tips & Tricks
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment