CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate:
Creating HTML(tables) without CGI.pm

 



Louis Mc
Deleted

Apr 14, 2000, 2:53 PM

Post #1 of 2 (505 views)
Creating HTML(tables) without CGI.pm Can't Post

I am not able to use CGI.pm. I'm trying to put this together without it. Is there a way to comibine these two processes - The grabbing of the lines and creating a table for each set?

This is the data, it arrives as @input :

ACCRT222 2381RH
BFGRT222 250OWLH
ACCRC222 2383LH3
BFGRT222 250OWRH

I only grab the lines with "ACCRC" at the beginning and break up the data into useable pieces.
---------------
my $sWant = "ACCRC";
my $sInput;

foreach $sInput ( sort grep { $sWant eq substr( $_, 0, 5 ) } @input ) {

$passData{"vend_id"} = substr($sInput, 0, 3);
$passData{"response_cd"} = substr($sInput, 3, 2);
$passData{"mdl_id"} = substr($sInput, 5, 3);
}

#Then generate enough tables in @tablehtml to hold the data

$NumberLines = grep(/ACCRC/i, @input);
my (@tablehtml);
$i = 0;
while ($i < $NumberLines){

push (@tablehtml,
"<CENTER>",
"<TABLE WIDTH=600>",
"<TR>",
"<TD>",
"$passData{"vend_id$i"}",
"<HR>",
"",
"$passData{"response_cd$i"}",
"<HR>",
"",
"$passData{"mdl_id$i"}",
"<HR>",
"",
"You should use your browser's bookmarks to go to your next page.",
"</TD>",
"</TR>",
"</TABLE>");

}
continue {
$i++;
}



Jasmine
Administrator

Apr 21, 2000, 11:05 PM

Post #2 of 2 (505 views)
Re: Creating HTML(tables) without CGI.pm [In reply to] Can't Post

I'm not certain I understand what you want - if you don't want to use CGI.pm (or can't), you can use straight HTML tags where you want the table to appear.

The table compilation code you posted looks okay, as long as you're outputting the contents of @tablehtml later.

Or am I totally confused?

[This message has been edited by Jasmine (edited 04-22-2000).]

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives