![]() |
|
Problems? Is your data what you think it is? | |
PerlMonks |
output to STDOUT or a fileby metaperl (Curate) |
on Sep 04, 2009 at 15:03 UTC ( #793480=snippet: print w/replies, xml ) | Need Help?? |
use IO qw(File Handle); my $io = do { if (shift) { my $tmp = IO::Handle->new; die "open failed: $!" unless $tmp->fdopen(fileno(STDOUT),"w"); $tmp; } else { my $tmp = IO::File->new('tmp.out', 'w'); $tmp; } }; $io->print("Some text\n");
|
|