open( FILE, "< $file" ) or die( "Bad things happened : $!" ); my $fh = \*FILE; # # Now use $fh as you see fit... # print $fh "Hello, world\n"; # Shouldn't work...FILE was opened RDONLY :-) $line = <$fh>; do_stuff( $fh ); sub do_stuff { my $fh = shift; print $fh "Whatever...\n"; }