[prev in list] [next in list] [prev in thread] [next in thread] 

List:       apache-modperl
Subject:    Re: Can't print to selected filehandle?
From:       Konstantin Khomoutov <flatworm () users ! sourceforge ! net>
Date:       2006-02-22 11:58:45
Message-ID: 20060222115845.GA1744 () proxysrv ! domain007 ! com
[Download RAW message or body]

Scott Gifford wrote:

>> First off I would convert it to using IO::File or somehow get
>> rid of using globs.  Such as my $fh = select; But this won't
>> solve your error, just makes the code easier to work with. 
>I actually tried that, but couldn't get it to work:
>
>    #!/usr/bin/perl -Tw
>     
>    use strict;
>     
>    print "Content-type: text/plain\n\n";
>     
>    my $fh = select;
>    print $fh "hi\n";
>
>results in: Can't use string ("main::STDOUT") as a symbol ref while
>"strict refs" in use at ./test.pl line 8.

Consider reading this excellent article:
http://perl.plover.com/local.html
(the section "The First-Class Filehandle Trick").

P.S.
Sorry for breaking the thread: I've accidentally removed it
and I'm now using the message from a mod_perl list mail archive.

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic