Trying to print from an HTML File
I am trying to include an external HTML file in my out put. I am using the following subroutine...
sub Print_Foot {
$prod_link = $_[0];
open(FOOT, ";
close(FOOT);
$n=1;
foreach $line (@foot) {
print "$line\n";
$n++;
}
}
1;
My HTML file contains...
$prod_link
I am sending the browser this...
print "Content-type: text/html\n\n";
$prod_link="test";
&Print_Foot($prod_link);
When it prints it just prints "$prod_link" not the data that $prod_link points to.
How do I pass the data stored in $prod_link to the &Print_Foot subroutine so I can get it to print from the HTML file?
Any Help would be great.
Thanks
G
Matt@Ikonboard posted this at 20:45 — 14th January 2001.
They have: 16 posts
Joined: Jan 2001
May be better written as:
sub Print_Foot {
my $Swop = $_[0];
open FOOT, '<Library/foot.html' or &ErrorMessage;
while (<FOOT>) {
$_ =~ s!\$prod_link!$Swop!isg;
print $_, "\n";
}
close FOOT or die $!;
}
my $friends = qq[=:Jilly , Andrew , Peter & Harry:=];
print &welcome($friends), "2"; my @home;
sub welcome{my $s=shift; $s=~s{^(=\(.+?)(\:=)$}
{$_=$2;@home=split/[&,]/;}esgx;$friends= join'me',@home;
$friends=~s{(\A|\S|\s+)([A-Z]).+?(\s|\Z)}{$2}sge;my$c=-1;
$friends=~s{(me|\Z)}{++$c;@_=(qw|ust nother erl acker|);qq!$_[$c] !;}eg; $friends}
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.