e dot dot dot
home << Downloads << perl stdout capture

Sat, 07 Jan 2006

Amazing Perl output capturing `sniplet`
Here's a terrific little chunk of code I found while searching for a way to capture some output from a Perl script, the output of which was being used in a Server-Side-Include.

I wanted the ability to use the same script, capture the output into a variable, then "escape" the output for use as a javascript feed.

It works like a charm. All output going to STDOUT is captured into a variable without requiring any modification to your original subroutine.

You're then able to do some work on it before PRINTing it to the restored STDOUT.
Try it for yourself.


edit: Downloads/perl_stdout_capture.download...

Password:
Title:
Price:
Filename:
Body:
Link | Image | Paragraph | BR | Return | Create Amazon link
** FYI: an image size of approx. width=454 x height=351, is best
Delete this item?:
home << Downloads << perl stdout capture