#!/usr/bin/perl use strict; open(LOG,"log.txt") ||die"$!"; select LOG; #...do stuff here close LOG; select STDOUT; # I love ar0n :) my $thing = do { local @ARGV = "foo.txt"; <> }; print $thing;