#!/usr/bin/perl -T use strict; use CGI; my $cgi = CGI->new(); my $nodeid= $cgi->param('node'); if ($nodeid=~s/^(\d{6})$/$1/){} else{nonode()} open (my $fh,"<","../htdocs/perlmonks/$nodeid.xml") or nonode(); print $cgi->header(-type=>'text/xml'); while (<$fh>) { print $_ } sub nonode { print $cgi->header, $cgi->start_html, "

Error! No such node id $nodeid

", $cgi->end_html; die ""; }