When we click on the Hyperlink of subject a new HTML Page should be pop up and shows the body of the mail.
I have written two perl codes first is for displaying the page with folders with subject another perl code having function to show the body.How can I integrate them so tht first code which is having hyperlink on subject directly goes to the HTML page which shows body of the mail i.e. another perl code which is having function to display this.

Thanks

Member Avatar for Dukane

You could open the HTML file, read it into an array, then line for line print it back to the browser.

For example:

open (HTMLDOC, "<../path/to/your/file.htm");
flock (HTMLDOC, 1);
my @htmlFile = <HTMLDOC>;
close (HTMLDOC);

print "Content-type: text/html\n\n";
foreach (@htmlFile) {
print $_;
}

alternatives that do the same thing:

print directly from file:

print "Content-type: text/html\n\n";
open (HTML, "<../path/to/your/file.htm");
print <HTML>;
close (HTML);

use a scalar instead of an array (slurp mode)

print "Content-type: text/html\n\n";
open (HTML, "<../path/to/your/file.htm");
my $html = do {local $/; <HTML>}; 
close (HTML);
print $html;

Can javascript be included in the above form of display?
I don't see my js functioning in my case.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.