my $f = Filter::Handle->new(\*STDOUT, output => sub { my($file, $line) = (caller(1))[1,2]; return sprintf "%s:%d - %s\n", $file, $line, join ' ', @_; } ); print "Foo";