Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: IO::Scalar on Apache Weirdness

by blahblahblah (Priest)
on Oct 10, 2002 at 02:31 UTC ( [id://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?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (2)
As of 2025-01-18 07:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which URL do you most often use to access this site?












    Results (56 votes). Check out past polls.