in reply to How do I print output to STDOUT instead of to an HTML file?

First off when posting code put it in <code> <\code> tags. So:
#!/usr/local/bin/perl @machines = qw( host1.foo.com host2.foo.com host3.foo.com ); $HTML = "\n"; $HTML .= " \n"; $HTML .= " \n"; foreach $machine (@machines) { $response = `ping $machine`; $HTML .= "$machine: $response"; } $HTML .= " \n"; $HTML .= " \n"; $HTML .= "\n"; open(HTMLFILE, ">pingresults.html") || die "Couldn't open pingresults\ +n"; print HTMLFILE "$HTML\n"; close (HTMLFILE);
Kill the "open" and "close" lines and change the print to:
print "$HTML\n";
There are better ways to do these kinds of things, so do some reading and searching around here and you will learn some things for the long run. Also, learn the first two rules of good Perl: use the "-w" flag on the #!/usr/local/bin/perl -w line and learn/read about "use strict". Life will be much less painful in the long run.

-THRAK
www.polarlava.com