#!/usr/bin/perl -wT use strict; open (FOO, '>/tmp/foobar') or die "Couldn't open /tmp/foo: $!\n"; my $self = { 'fh' => \*FOO}; print $self->{'fh'} "This is a test\n";