RESOLVED: The problem was that I was doing

$c->start_td(-id=>'foo', -width=>'20', -valign=>'top'),

instead of

$c->start_td({-id=>'foo', -width=>'20', -valign=>'top'}),

The CSS must look for 'foo' and it didn't find it because the perl script was incorrect. It provided <td> instead of <td id="foo" etc>.

---------------------

I inherited a webpage which includes a .inc file. The resulting combination is somehow styled by a CSS file. It works great.

I want to change from the .inc file to a perl script so that it can change dynamically. I created a script which outputs exactly the same contents of the .inc file and included it by simply changing the line

<!--#include file="foo.inc"-->

with the line

<!--#include file="cgi-bin/bar.pl"-->

I'm using apache with server-side includes turned on.

Everything works perfectly except that no formatting is applied to the portion of the page which was previously described by the .inc file and now is created by the .pl file.

Any ideas? I've tried adding a link to the CSS file as a parameter to the the start_html method ('-type'=>'text/html', '-src' => '/css/foo.css'). I tried renaming the .pl to a .css. (Dumb idea, but worth a shot.)

Apologies if this is a dumb question. I've never used CSS before.


In reply to Included cgi does not get CSS formatted? by Jman1

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.