in reply to Redirecting STDOUT and standard error to file
#!/usr/bin/perl -w use strict; sub multiprint { for (*FILE, *STDOUT) { print $_ @_; } } open FILE, '>tmp' or die; multiprint('test'); close FILE; [download]