tame1 has asked for the wisdom of the Perl Monks concerning the following question:
The real problem now comes up. ANY use/call of $code->($href) will activate the print statements inside the slurped file. This was fine with the following:my $code; my $compartment = new Safe; $compartment->share('$href'); $code = $compartment->reval($$file); if ($@) { _sAbort( $r, "Restricted eval failed! Unable to compile format of +type $type:", $@ ); return DONE; }
But now I am trying to instead grab the output of $code and stick it as text into an email. (You guessed it - I'm trying to email generated web pages - HTML email, yuck!).$r->send_http_header('text/html'); $code->($href); return DONE;
Any of you geniouses know offhand how I can get this darned HTML output from the code ref $code into a simple variable so i can give it to MIME::Lite as data? Much gracious bowing and licking of boots are offered to the one who can solve this for me!my $open_err; my $data; open(OUTPUT, "$code->($href) |") or $open_err = $!; if ($open_err) { _sAbort($r,"Cannot open a pipe",$!); return DONE; } local $/ = undef; $data = <OUTPUT>; close(OUTPUT);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Redirecting STDOUT
by SarahM (Monk) on Jun 14, 2002 at 13:54 UTC | |
by mt2k (Hermit) on Jun 15, 2002 at 04:20 UTC | |
|
Re: Redirecting STDOUT
by Abigail-II (Bishop) on Jun 14, 2002 at 14:44 UTC | |
|
Re: Redirecting STDOUT
by Dog and Pony (Priest) on Jun 14, 2002 at 13:50 UTC | |
|
(RhetTbull) Re: Redirecting STDOUT
by RhetTbull (Curate) on Jun 14, 2002 at 16:56 UTC | |
by Anonymous Monk on Jun 14, 2002 at 22:04 UTC | |
|
Re: Redirecting STDOUT
by Anonymous Monk on Jun 14, 2002 at 14:21 UTC | |
|
Re: Redirecting STDOUT
by BUU (Prior) on Jun 15, 2002 at 18:43 UTC |