in reply to POE::Component::Server::HTTP and CSS

I don't know if this will help, but the documention for CGI specifies a reference to an array should be passed to "head" when more than one element needs to be supplied.
sub header_css { my @css_style_sheets = ( "http://othermachine/css/standard.css", "http://othermachine/css/ssd.css", ); my @head_links; foreach (@css_style_sheets) { push(@head_links, Link({ -rel => 'stylesheet', -type => 'text/css', -href => $_ })); } return \@head_links; }

Replies are listed 'Best First'.
Re^2: POE::Component::Server::HTTP and CSS
by jfroebe (Parson) on Jan 10, 2006 at 19:23 UTC

    Thanks! :) You're correct about the reference to the array in the documentation. CGI.pm takes either a scalar or a reference to an array even with multiple items since the two css links are viewed as just text.

    Unfortunately, the hang remains. :( I'm suspecting the culprit to be the buffering even though $|++ is specified. I'll do some research to see if flushing is handled differently in POE (probably is ;-)

    Jason L. Froebe

    Team Sybase member

    No one has seen what you have seen, and until that happens, we're all going to think that you're nuts. - Jack O'Neil, Stargate SG-1

      How can bufferning be an issue? You don't write to anything.

        Actually I am. Check out MainHandler() which is the content handler. The $response->content() will return to the web client the data specified. In this case, I'm calling the sub get_content().

        sub MainHandler { my ($request, $response) = @_; $response->code(RC_OK); $response->content( get_content($request) ); return RC_OK; }

        The handler is declared in create_httpd() which I didn't include in the OP :

        sub create_httpd { my ($kernel, $heap, $Port) = @_[KERNEL, HEAP, ARG0]; $kernel->alias_set('httpd_parent'); my $httpd = POE::Component::Server::HTTP->new ( Port => $Port, ContentHandler => { '/' => \&MainHandler } ); $heap->{httpd} = $httpd; }

        Jason L. Froebe

        Team Sybase member

        No one has seen what you have seen, and until that happens, we're all going to think that you're nuts. - Jack O'Neil, Stargate SG-1