This is so lame, I could not come up with a better title. I'm starting to work myself in a frenzy.

Basically, I want to keep up with timestamps of some files. I'm using File::stat, and it works just fine. What DOESN'T work just fine, is that I'm running another script that outputs a few lines, and I'm trying to print out those few lines. When I run the script from a terminal, they print out no problem. However, they do not show up in the web browser when I run it there. The tags *should be* okay.

Don't mind the rsh and other junk -- I'm checking files on other machines, but that's not the issue. Doesn't work locally either.

#!/usr/bin/perl use strict; use CGI; my @nodes = qw|node1 node2|; my $query = CGI->new(); print $query->header( "text/html" ), $query->start_html(-title => "doesn't work"), $query->h1( "Here we go!" ); foreach my $node ( @nodes ) { open ( IN, "rsh -l cmtd $node /path/to/script.pl |" ) || die "de +ad $!"; while ( <IN> ) { print $query->h1($node); print $query->h1($_); } } $query->end_html;
As before, the script works on a terminal, as do the remote scripts. They're just not passed to the browser for some goofy reason. The "Here we go" string prints out, so there's no funky header or tag business going on.

The reason I'm calling the other script in the first place and not just running File::stat on the main script is b/c I can only access them on other machines. NFS isn't an option at the moment.


In reply to General CGI problem. by GaijinPunch

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.