Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

Re: IO::Scalar on Apache Weirdness

by blahblahblah (Priest)
on Oct 10, 2002 at 02:31 UTC ( #204085=note: print w/replies, xml ) Need Help??

in reply to IO::Scalar on Apache Weirdness

I've used IO::Scalar in cgi scripts on apache before, and your code looked pretty similar to mine, so I thought I'd see what was different. In my code I never did anything with the return value from tie, and I think that's what's breaking for you. It's the "close $SH" line that's the problem. I tried the following script on my apache, and did not see any output:
#!/usr/local/bin/perl print "Content-type: text/html\n\n"; use IO::Scalar; my $output; my $SH = tie *STDOUT,'IO::Scalar', \$output; print "hey\n"; $result = "output: $output"; close $SH; untie *STDOUT; print $result;
Then I commented out the "close" line, and it worked! I'm not sure why -- I would have expected to at least see "output:" no matter what.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://204085]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (3)
As of 2020-09-25 23:19 GMT
Find Nodes?
    Voting Booth?
    If at first I donít succeed, I Ö

    Results (141 votes). Check out past polls.