Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Ongoing LWP impass... advise please?

Reply
Thread Tools

Ongoing LWP impass... advise please?

 
 
at
Guest
Posts: n/a
 
      12-06-2003
Thanks for the several responses I have received all of which I have
tried. However, the program seems to fail during executing always at
the same spot. I receive NO error messages, but I receive NO response
other than the html page being sent to me again. I would assume this
indicates an error so retry.

Here is my code snippet. How would one go about altering this to
make it work?
================================================== ====

my $URL2="https://www.blah.com";
my $DATA="";
my $fname="filename";

open(TFH,"<$filename.in") or die "Cannot Open $filename.in\n";
while(<TFH>) {
$DATA.=chomp($_);
}
close(TFH);

$REQ= POST $URL2,
[ NETCONNECT_TRANSACTION => $DATA ];

$RSP=$UA->request($REQ, "$filename.out");


================================================== ===

The above request should be a rather normal POST request and the
content should be the descriptor "NETCONNECT_TRANSACTION=" and the
field $DATA is the entire contents of an XML formatted file. There is
also a cookie automatically attached to the request that was
previously retrieved after authenticating with the remote host.

The request line should write the response received from the remote
host into the file $filename.out.

Any guidance, advise, code revisions, etc. will be G-R-E-A-T-L-Y
appreciated.

Bob
 
Reply With Quote
 
 
 
 
Tad McClellan
Guest
Posts: n/a
 
      12-06-2003
at <R.MariottiFinancialDataCorp.com> wrote:

> How would one go about altering this to
> make it work?


> while(<TFH>) {
> $DATA.=chomp($_);
> }



Have a look at what value you have collected at this point:

print $DATA;

Then you might figure that you're goint to have to read the
documentation for the function that you are using to find out
what it returns:

perldoc -f chomp

The 2nd sentence should help solve your problem.



To my mind, the return value from chomp() is not useful, so it is a
red flag to me when I see the return value from chomp being used.


> Any guidance, advise, code revisions, etc. will be G-R-E-A-T-L-Y
> appreciated.



Use the docs, Luke.


--
Tad McClellan SGML consulting
http://www.velocityreviews.com/forums/(E-Mail Removed) Perl programming
Fort Worth, Texas
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Ongoing Vonage problems Boborann VOIP 13 08-31-2007 08:45 PM
This Vonage/Sipgate ongoing discussion BadLadsArmy UK VOIP 26 08-15-2005 03:45 PM
device drivers error MS screen says sorry........xp crashing ongoing =?Utf-8?B?REo=?= Microsoft Certification 0 04-16-2004 04:26 PM
PIX 515 drops ongoing VPN sessions Nicklas Cisco 0 11-24-2003 10:57 PM
Ongoing Bios Password Problem for Sony Vaio FX Series Treb Computer Support 5 11-24-2003 02:35 PM



Advertisments