Other options include returning a filehandle from a subroutine and printing to that wherever you go. Remember, you can return a typeglob and capture it in a scalar.sub output { my $text = shift; print STDOUT $text; } sub output_logged { my $text = shift; local *STDOUT; open(STDOUT, "| tee $filename") || die "Can't open pipe: $!"; print STDOUT $text; close STDOUT; }
In reply to Re: Multiple outputs in a CGI script
by chromatic
in thread Multiple outputs in a CGI script
by Cirollo
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |