in reply to Printing a Html Page

You want to use something like LWP::Simple for this.

#!/usr/local/bin/perl -wT use CGI qw(:standard :html3); use LWP::Simple; use strict; my $locat = "http://www.nsn.org/elghome/material_office2.html"; # note that there is no better diagnostic info from get() my $html = get( $locat ) or die "Could not read data from $locat"; print header, start_html, $html, end_html;

However, using this version of get() means you will not be able to check the response codes or headers, if necessary. $html will simply be undef on failure. If you still have troubles, read the LWP::Simple docs for how resolve this issue (&get_print, for example, gives you response codes that you can check, but it clearly has the side-effect of directly printing the data).

Cheers,
Ovid

Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.