Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

File handlers

Status
Not open for further replies.

Capellone

Programmer
Dec 6, 2005
4
RO
Hello,

What kind of perl variable is a file handler? How to make a file handler to be an "instance memeber"? I have a perl class module for writing to a file - each object (insatnce of this class) write to its own file; i want any object to keep its file handler, but i dont know how to declare a file handler as a "instance variable" (altough i did it with "regular" perl variables). Could you help?

Thanks.
 
I know:
Code:
use Symbol;
#

sub new
{
	my $class = shift;
	my $this = bless {}, $class;
        $this->{FILEHANDLER} = gensym;	
        open ($this->{FILEHANDLER},">$fileName") || die "Unable To Open file $fileName";
        
	return $this;
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top