If you have control over the shell, simply redirect output to a file or another process:
$ perl myprog.pl > output $ perl myprog.pl | less
If you need to print to a file from within the program, you'll have to close STDOUT and reopen it to a file. The shell's the way to do this.
In reply to Re: Can I print the result to a file
by chromatic
in thread Can I print the result to a file
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |