this is NOT a javascript question. i tried asking this question on the chatterbox, but i don't think i'm asking it right. the question is: i want my perl script to print out javascript, just like it would print out html. i've been told it's possible. i've tried using <<'HERE'; but i got a blank screen (and no error messages). Do I need to escape everything, or is this impossible in the first place? I've looked around for examples, but can't find any. Can anyone point me in the right direction?
#!c:/Perl/bin/Perl -wT use strict; use CGI qw/:standard/; print header; print "can you hear me"; #this does print, nothing else does print "<html>"; print "<head>"; my $javascript = <<'TOAD'; <style> <!-- all.clsMenuItemNS{font: bold x-small Verdana; color: white; text-decor +ation: none;} .clsMenuItemIE{text-decoration: none; font: bold xx-small Verdana; col +or: white; cursor: hand;} A:hover {color: red;} --> </style> TOAD print "</head>"; my $javanext = <<'FROG'; <script language="JavaScript" src="/menu.js"> </script> <script language="JavaScript" src="/menucontext.js"></script> <script language="JavaScript"> showToolbar(); </script> <script language="JavaScript"> function UpdateIt(){ if (document.all){ document.all["MainTable"].style.top = document.body.scrollTop; setTimeout("UpdateIt()", 200); } } UpdateIt(); </script> FROG print "</HTML>";

In reply to print html/javascript by malaga

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.