Summary: obtain web page contents with perl through proxy server

2003-08-10 Thread wendy soros
Hi,

Thanks to Awarsd, Wiggins, and Patricia for your quick
replies. As all of you suggest,
I will have a look at the LWP module first. I guess I
will trouble you guys/girls again when
I find problems learning the LWP module. 

Thanks a lot.

Wendy


__
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Perl line breaks

2003-08-10 Thread Camilo Gonzalez
Mike Harrison wrote:

Hello all,

Well, I have spent the last few nights messing around trying to work out why
one of my PERL programs doesn't work.  If anybody can shed some light on
this, I might be able to get some sleep :)
I am using a hosting service to host my web site, and they use a Microsoft
NT-based server system (sorry, I don't know the nitty-gritty details).  They
allow user cgi programs (PERL, PHP etc.), and until now most of my PERL
programs have worked as expected.  I am using NTEmacs as a text editor for
my HTML & PERL programming.
With one program, I am getting an error message as follows:

CGI Error
The specified CGI application misbehaved by not returning a complete set
of HTTP headers. The headers it did return are:
(nothing else is printed to the screen after 'The headers it did return
are:')
My question is:  Are line breaks important with PERL programs, and if so,
any tips?  If line breaks are not likely to be the problem in this case,
does anybody know why I am getting this error?
Note that I have a similar PERL program in the same directory that works
fine.  So I think it is my program and not the web server...  It might be I
have overlooked an important detail that I can't see on the screen - such as
line breaks or other non-printable characters???
Thanks in advance for any help,
Mike.
 

How are you generating your HTTP headers? Can you post some code?

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: Perl line breaks

2003-08-10 Thread Mike Harrison
Hi All,

Well, I have fixed the problem.  I converted the messy html output from a
series of ugly print statements (complete with escaping for every "
character) to a heredoc as follows:

print 
To: "'Octavian Rasnita'" <[EMAIL PROTECTED]>; "Jon Hogue" <[EMAIL PROTECTED]>
Cc: "'Andrew Brosnan'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Wednesday, August 06, 2003 2:24 AM
Subject: RE: Perl line breaks


I was trying to find a log file to look at.  I guess half the problem is I
am using a hosting service, and it is on a Microsoft IIS server (Windows
NT-based I think, but definitely not UNIX).  I will have to ask the hosting
admin where I might find a log file...

Here is the part of the perl script that I start printing things to the
browser (see previous message for the html.pm script that contains the
HTML_header and HTML_ender subroutines):

my $header = 'Successful update';
my $msg = "Your preferences have been updated
successfully...";

# Finally, put up a HTML document announcing that the update was successful.
&HTML_header($header);
print "\n";
print "\n";
print "$msg\n";
print "Return to the Account Management
page\n";
print "\n";
&HTML_ender;

Note that I have also tried using print qq| ... | code as well.

I am now getting a CGI error message along the lines of
Cannot find a string terminator '"' in ... line ... (the line above starting
with print "... ".  I can't find a problem with that line???

Thanks for your help so far guys!  I am losing a bit of sleep on this one :(
Regards,
Mike.


-Original Message-
From: Octavian Rasnita [mailto:[EMAIL PROTECTED]
Sent: Wednesday, 06 August, 2003 2:30 AM
To: Jon Hogue
Cc: Mike Harrison; 'Andrew Brosnan'; [EMAIL PROTECTED]
Subject: Re: Perl line breaks


For troubleshooting a script you can take a look in the server's log file
and you will find there any error.

Teddy,
Teddy's Center: http://teddy.fcc.ro/
Email: [EMAIL PROTECTED]

- Original Message -
From: "Jon Hogue" <[EMAIL PROTECTED]>
To: "Octavian Rasnita" <[EMAIL PROTECTED]>
Cc: "Mike Harrison" <[EMAIL PROTECTED]>; "'Andrew Brosnan'"
<[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Tuesday, August 05, 2003 4:19 PM
Subject: Re: Perl line breaks



>
>...and you don't need to print the HTML header in the BEGIN {} block.
>You can just print it at the top of the perl program or in the middle of
the
>program but before anything else is printed.

if something is dieing in a module you are loading, you will never know
about it because it will never get to the Content-Type and therefore never
send anything good to your browser. if you use a BEGIN block, you might
catch things that happen in modules you load. i wouldn't recommend doing
that for your normal script, but it is a useful troubleshooting tool.