I've got the task to change all the small CGIs to have a logo on top of the site. To edit all that scripts is against Laziness, so i thought about a different approach - using frames. I build this small and simple wrapper. If it is called with a parameter 'app' it outputs the right CGI as part of a frameset and the browser does the job. In fact this just works 'cause all CGIs are called from only one page.
#!/usr/bin/perl use strict; use warnings; use CGI; use CGI::Carp qw ( fatalsToBrowser ); use HTML::Template; my $q = new CGI; my $app = $q->param('app') || 'help'; my $template = HTML::Template->new(filename => 'app_wrap.tmpl'); my $application_to_call = '/main.html'; $application_to_call = '/cgi-bin/staff.pl' if ($app eq 'staff'); $application_to_call = '/db/staff/selstad.pl' if ($app eq 'adm_sta +ff'); $application_to_call = '/db/staff/birthday.pl' if ($app eq 'birthd +ay'); $application_to_call = '/db/staff/firmenjub.pl' if ($app eq 'jubilee') +; $application_to_call = '/db/staff/location.pl' if ($app eq 'locati +on'); print $q->header(); $template->param(app => $application_to_call); print $template->output(); exit;
and a html-template snippet:
<!-- snip --> <frameset frameborder="no" framespacing="0" border="0" rows="80,*"> <frame marginwidth="0" marginheight="0" scrolling="no" src="/logo_t +op.html"> <frame name="main" src="<TMPL_VAR NAME="app">"> </frameset> <!-- snip -->

In reply to How to get those CGIs running in a frame. by neniro

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.