Hi,

I'm using POE::Component::Server::HTTP and wish to add a stylesheet using CGI.pm but I'm having a spot of trouble.

What's happening is that when I add the css_link line to the headers, the script will appear to hang. If I kill the script (SIGINT) then the rest of the html code is magically sent to the web client. I don't think it has to do with buffering (see $|++ below). If I remove the css_link line, it runs fine. If I manually enter the css header line instead of calling a subroutine, it hangs.

I'm thinking it is something simple that I'm just overlooking. Any one see what I am not?

$|++; sub MainHandler { my ($request, $response) = @_; $response->code(RC_OK); $response->content( get_content($request) ); return RC_OK; } sub get_content { my $request = shift; my $my_content; $my_content = start_html( -title => $request->uri, -head => header_css() ); $my_content .= end_html(); return $my_content; } ########### ########### sub header_css { my @css_style_sheets = ("http://othermachine/css/standard.css", "h +ttp://othermachine/css/ssd.css"); ### in order to support multiple style sheets, ### we need to explicitly run CGI Link() ### we link only to those style sheets that ### actually exist my $css_link = ""; foreach (@css_style_sheets) { $css_link .= Link({ -rel => 'stylesheet', -type => 'text/css', -href => $_ }); } return $css_link; }

UPDATE: Looks like it was an issue of the remote css links and not the code itself. Argh. Certainly feels like monday

Thanks ikegami for the help as you made me see the light when I explained where the output was going! :)

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


In reply to POE::Component::Server::HTTP and CSS by jfroebe

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.