Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Include an ASP page in a Perl generated page

Status
Not open for further replies.

SnaveBelac

Programmer
Oct 21, 2003
89
GB
I understand how to include a file into a Perl genereated web page and am using the the following code...

Code:
sub include {
	my $filename = shift;
	open(FH, "<$filename") || die "cannot open $filename: $!\n";
	while (<FH>){
		print $_;
	}
	close FH;
}

Does anyone know of any way that the included file can be a processed *.asp file? I would like to include a header but there is some conditional processing that needs to go on to show the relevent images etc. I am thinking that this is not possible but I would like to be sure... I have a web server running IIS5.0 and ActivePerl 5.8

Any help would be much appreciated

----------------------------
SnaveBelac - Adventurer
----------------------------
 
no reason why not; instead of including the file call the asp page through a GET request to the web host, and print the result to the screen.

<marc> i wonder what will happen if i press this...[ul][li]please tell us if our suggestion has helped[/li][li]need some help? faq581-3339[/li][/ul]
 
The headers (as I understand it) would have to come from the perl script, but whether you can include another server side component is something I'm definitely not sure of.

If you write out SSI directives as part of your script, they don't get executed because the pages aren't being served up as normal from the webserver, and are being generated by Perl.

I've had this problem in the past and ended up using JavaScript to get around it.

Code:
<script language=JavaScript src=/cgi-bin/myscript.pl?params=XXX&otherparams=YYY>
</script>

It's important also to note the first thing you need to output from your script is the proper Content-Type header
Code:
print JS "Content-Type: text/javascript\n\n";

HTH
--Paul
HTH
--Paul
 
Thanks for the suggestions. I will have a go with these things and let you know which works the best for me.

Thanks again - I will be in touch

----------------------------
SnaveBelac - Adventurer
----------------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top