in reply to Adding properties to a blessed file handle reference
Since filehandles are typeglobs, you can access its associated hash and stick stuff in it. For example,
sub set_foo { my $self = shift; my $val = shift; ${ *$self }{foo} = $val; }
Update: I think you can also just say *$self->{foo} = $val; which is less ugly.
|
|---|