in reply to Re: open $self->{FILE}
in thread open $self->{FILE}

I think his question is how to implement something like the methods you've shown. He's asking how to do it in from inside the object, thus he's trying to access the object's data members. At least, that's the impression I got...

Replies are listed 'Best First'.
Re^3: open $self->{FILE}
by radiantmatrix (Parson) on Nov 05, 2004 at 21:13 UTC

    If you're correct...

    package Something; .... #package stuff sub print { my $self = shift; my $FH = $self->{FILE}; #deref the FILE handle return print $FH join('',@_); } #and likewise with others.

    The above would be easier to read and maintain than the whole print { $self->{FILE} } "text" notation, IMO.

    radiantmatrix
    require General::Disclaimer;
    "Users are evil. All users are evil. Do not trust them. Perl specifically offers the -T switch because it knows users are evil." - japhy