Instead of loading an entirely new web page (header | middle | footer) with the output, I am wondering whether it is possible to include the output to the same webpage that is already open. Perhaps with SSI -- where there is a header | middle | footer, the output could go into the middle section?
<!--#include file="header.include.shtml" --> <hr COLOR="#CCCCCC" size=1 NOSHADE> <!--#exec cgi="/cgi-bin/test.cgi"--> <!--#include file="footer.include.shtml" -->
#!/usr/bin/perl use CGI qw(:standard); print "Content-type: text/html\n\n"; my $dir = '/home/lawlist/www'; my $query = new CGI; my $name = $query->param('name'); my $file = $dir . "/" . $name; if ($name) { open(FILE,'/home/lawlist/www/header.include.shtml') and print <FILE> +; close FILE; } opendir(DIR, $dir) or die $!; while (my $file = readdir(DIR)) { next unless (-f "$dir/$file"); next unless ($file =~ m/\.txt|.el$/); print '<a href="/cgi-bin/test.cgi?name=' . $file . '">' . $file . "< +/a>" . "<br>" . "\n\n"; } closedir(DIR); if ($name) { open (DATA, $file) or return $self->print_json_error($self->language +('ERR_CANNOT_OPEN', $file->{name}, $!)); read (DATA, my $file, -s DATA); close DATA; print "<br>\n\n<br>\n\n"; print '<pre class="brush: lisp">' . "\n\n" . $file . "\n" . '</pre> +'; print "\n\n<br>\n"; open(FILE,'/home/lawlist/www/footer.include.shtml') and print <FILE> +; close FILE; } exit 0;

In reply to Is it possible to output to an open web page? by lawlist

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.