#!/usr/bin/perl -w use strict; my $file = 'temp.html'; open HTML, ">$file" or die "Damn: $file $!"; print HTML "\n"; print HTML " $_ " while <>; print HTML "\n\n"; close HTML or die $!; # close(STDIN); # links breaks if I close it explicitly die "System command failed $_" if system('links', $file) == -1;