Front page | perl.beginners |
Postings from April 2002
Re: no output from the script
Thread Previous
|
Thread Next
From:
John Martin
Date:
April 1, 2002 09:57
Subject:
Re: no output from the script
Message ID:
20020401175717.13955.qmail@web13503.mail.yahoo.com
STOP SPAMMING ME!!!!
--- drieux <drieux@wetware.com> wrote:
>
> On Monday, April 1, 2002, at 08:15 , Joe Echavarria
> wrote:
>
> that he was having problem with the cgi script -
>
> amongst other things there is no 'start_html' in it
> to make sure that it is set up correctly.
>
> I would propose something on the order of the script
> at
> the end, where I would isolate the two open and read
> calls.
> Since I of course do not have the 'data' - this also
> allows
> me to stub those functions out.
>
> Ok, so I am also a Freak about calling 'print once'.
> so I
> have this compulsion about setting up the page.....
>
> this of course does not take into account the 'so
> what if
> I am called when there is a POST' ...
>
> ### #!/usr/bin/perl -w
> ###
> ### use strict;
> ### use CGI qw/:standard/;
> ###
> ### sub get_lists { my @list = qw/ dog:pedro
> cat:alice foo:bar/ ; @list;
> }
> ###
> ### sub get_catagoria { my @list = qw/ dog:doggie
> cat:catneff foo:fooNaff/
> ;
> ### @list;
> ### }
> ###
> ### sub get_firstPage {
> ###
> ### my $page = start_html('- LISTA DE LINKS -');
> ### $page .= "<B>Lista de Categorias
> </B><BR><BR>";
> ###
> ### $page .= start_form; #take the defaults
> ###
> ### $page .= '<select name="categorias"
> size="1">';
> ### my @categorias = get_catagoria;
> ###
> ### while ( my $file1 = pop(@categorias) ) {
> ### my ($no,$desc)=split(":",$file1);
> ### $page .= "<option
> value=\"$no\">$no</option>";
> ### }
> ###
> ### $page .= "</select><Input type=\"submit\"
> value=\"GO\">";
> ###
> ### $page .= end_form;
> ### $page ;
> ###
> ### } # end get_firstPage
> ###
> ### sub append_table {
> ###
> ### my ($page) = @_;
> ###
> ### my @lista = get_lists ;
> ###
> ### my @TableRow = ();
> ###
> ### while ( my $file = pop(@lista) ) {
> ### my ($categoria,$link) =
> split(":",$file);
> ### push( @TableRow ,
> td([$categoria,$link]));
> ### }
> ### $page .= table( {border=>5, cellpadding=>5},
> ### caption("LISTA DE LINKS"),
> ###
> ### TR( [
> ### th(['TEMA', 'LINK']),
> ### @TableRow
> ### ]));
> ###
> ### $page ;
> ###
> ### } # end append_table
> ###
> ### sub send_page {
> ###
> ### my ($page) = @_;
> ### $page .= end_html;
> ###
> ### print header, $page ;
> ###
> ### } #end send_page
> ###
> ### #---------------------
> ### #
> ###
> ### my $theHtmlPage = get_firstPage;
> ###
> ### $theHtmlPage= append_table($theHtmlPage);
> ###
> ### send_page($theHtmlPage);
> ###
> ###
>
>
>
>
> ciao
> drieux
>
> ---
>
>
> --
> To unsubscribe, e-mail:
> beginners-unsubscribe@perl.org
> For additional commands, e-mail:
> beginners-help@perl.org
>
__________________________________________________
Do You Yahoo!?
Yahoo! Greetings - send holiday greetings for Easter, Passover
http://greetings.yahoo.com/
Thread Previous
|
Thread Next