- From: Matt Gray <g3021906@student.anu.edu.au>
- Date: Sun, 13 Sep 1998 05:30:48 -0400 (EDT)
- To: www-validator@w3.org
Hi, I've been using the patch provided by Bernhard Weisshuhn on this newgroup to use the lwp-request call. I've found that in order to handle server errors properly I had to take out some 'die' lines in the code, otherwise the script will exit too early without printing any of the error messages to the user. I don't know if this was a problem when using the original 'get' command, or whether it is something particular to my computer (running Linux Redhat 5.1). The changes are as follows: -------------------------- Old code: -------------------------- open( URI, "$grabber \"$uri_escaped\" |" ) || die "couldn't retrieve uri: $!"; @file = <URI>; close( URI ) || die "couldn't close uri retrieval pipe: $!"; -------------------------- New code: -------------------------- open( URI, "$grabber \"$uri_escaped\" |" ); # || die "couldn't retrieve uri: $!"; @file = <URI>; close( URI ); #|| die "couldn't close uri retrieval pipe: $!"; Regards, Matt Gray. >Enjoy, and feel free to comment or correct. > >regards, >Bernhard Weisshuhn > >Index: check >=================================================================== >RCS file: /sources/public/validator/httpd/cgi-bin/check,v >retrieving revision 1.7 >diff -r1.7 check >24c24 >< $abs_svc_uri = "http://validator.w3.org/"; >--- >> $abs_svc_uri = 'http://'.$ENV{'HTTP_HOST'}.'/'; >28c28 >< $grabber = "/usr/local/lib/libwww-perl/get"; >--- >> $grabber = "/usr/local/bin/lwp-request -Use"; >318a319,322 >> if (/^([0-9][0-9][0-9])\s+(.*)/ ) { >> ( $response, $message ) = ($1,$2); >> } >> >
Received on Sunday, 13 September 1998 14:50:25 UTC