Hello.
I have this program
$num_links = 4;
print "Content-type: text/plain\n\n";
my $LASTX = $num_links;
open (DB, "<admin/data/links.db");
my @lines = <DB>;
close DB;
#setup list
print qq|
<table><UL class="mainlinks">
|;
for ($i=$#lines; $i>=$#lines - $LASTX; $i--) {
chomp $lines[$i];
@fields = split(/\|/,$lines[$i]);
#----UNFORMATTED----
#foreach $field (@fields) {print "$field\n"};
#----FORMATTED----
print '<LI><a class="side" href=http://mysite.com/';
print "@fields[3]/";
print "@fields[0]";
print ".shtml>";
print @fields[1].'</A>';
print '</LI>';
print "\n";
}
#end list
print qq|
</UL></table>
|;now because cgi cant run in cgi i wanted to make it a global
<%hdln%>
what would be the correct procedure as to get the desired results?!
Thanks Again
Gian Wilson
I have this program
Code:
#!/usr/bin/perl $num_links = 4;
print "Content-type: text/plain\n\n";
my $LASTX = $num_links;
open (DB, "<admin/data/links.db");
my @lines = <DB>;
close DB;
#setup list
print qq|
<table><UL class="mainlinks">
|;
for ($i=$#lines; $i>=$#lines - $LASTX; $i--) {
chomp $lines[$i];
@fields = split(/\|/,$lines[$i]);
#----UNFORMATTED----
#foreach $field (@fields) {print "$field\n"};
#----FORMATTED----
print '<LI><a class="side" href=http://mysite.com/';
print "@fields[3]/";
print "@fields[0]";
print ".shtml>";
print @fields[1].'</A>';
print '</LI>';
print "\n";
}
#end list
print qq|
</UL></table>
|;
<%hdln%>
what would be the correct procedure as to get the desired results?!
Thanks Again
Gian Wilson