Just a quick question here.... Is anyone else having troubles getting Cookie data from an Apache server using Perl 5.8 on Win2K (yes Activestate build 804 see below for full details) I have a program that tries to log into a web server ( POST Method ) and should get back a Cookie with the "Secret handshake" to be used in following interaction with the web server. I get the confirmation document ( in the http content ) but an empty cookie. I'm at wit's end because the code works fine on Linux (RedHat 7.3 based, Perl version 5.6.1)and I'd like to not have two versions of the program. Both platforms use LWP 5.69, both use HTTP::Cookies version 1.30. Should I be at all concerned that perl -V reports osvers=4.0 while Microsoft has a habit of refering to Win2K as WIN NT Version 5.0? The offensive code is as follows.
use strict; use LWP; use HTTP::Cookies; #use XML::DOM; use XML::Twig; use Data::Dumper; my $oper = shift; chomp($oper); my $debug = shift; my $user = 'username'; my $pword = 'userpassword'; my $ua = LWP::UserAgent->new; $ua->cookie_jar( {} ); # A place to hold the cookies from ETS +S BO's $ua->agent("UPIXweb/1.0 "); # Create a request my $req = HTTP::Request->new(POST => 'http://etss.btv.ibm.com/xmes/p +ack/usermgr'); $req->content_type('application/x-www-form-urlencoded'); $req->content("operation=authenticateUser&userid=$user"."&password=$ +pword"); C:\>perl -V Summary of my perl5 (revision 5 version 8 subversion 0) configuration: Platform: osname=MSWin32, osvers=4.0, archname=MSWin32-x86-multi-thread uname='' config_args='undef' hint=recommended, useposix=true, d_sigaction=undef usethreads=undef use5005threads=undef useithreads=define usemultip +licity=define useperlio=define d_sfio=undef uselargefiles=define usesocks=undef use64bitint=undef use64bitall=undef uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='cl', ccflags ='-nologo -Gf -W3 -MD -DNDEBUG -O1 -DWIN32 -D_CON +SOLE -DNO_STRICT -DHAVE_DES_FCRYPT -DPE RL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -DPERL_MSVCRT_REA +DFIX', optimize='-MD -DNDEBUG -O1', cppflags='-DWIN32' ccversion='', gccversion='', gccosandvers='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234 d_longlong=undef, longlongsize=8, d_longdbl=define, longdblsize=10 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='__int64 +', lseeksize=8 alignbytes=8, prototype=define Linker and Libraries: ld='link', ldflags ='-nologo -nodefaultlib -release -libpath:"C:\ +Perl\lib\CORE" -machine:x86' libpth="C:\Program Files\Microsoft Visual Studio\VC98\mfc\lib" "C: +\Program Files\Microsoft Visual Studio\V C98\lib" "C:\Perl\lib\CORE" libs= oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib + comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib netapi32.lib uuid.lib wsock32.lib mpr.lib winm +m.lib version.lib odbc32.lib odbccp32.l ib msvcrt.lib perllibs= oldnames.lib kernel32.lib user32.lib gdi32.lib winspool +.lib comdlg32.lib advapi32.lib shell32. lib ole32.lib oleaut32.lib netapi32.lib uuid.lib wsock32.lib mpr.lib +winmm.lib version.lib odbc32.lib odbccp 32.lib msvcrt.lib libc=msvcrt.lib, so=dll, useshrplib=yes, libperl=perl58.lib gnulibc_version='undef' Dynamic Linking: dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' ' cccdlflags=' ', lddlflags='-dll -nologo -nodefaultlib -release -l +ibpath:"C:\Perl\lib\CORE" -machine:x86' Characteristics of this binary (from libperl): Compile-time options: MULTIPLICITY USE_ITHREADS USE_LARGE_FILES PERL +_IMPLICIT_CONTEXT PERL_IMPLICIT_SYS Locally applied patches: ActivePerl Build 804 Built under MSWin32 Compiled at Dec 1 2002 23:15:13 @INC: C:/Perl/lib C:/Perl/site/lib .
Somebody get me out of these "Twisty little passages, all alike".... Thanks, The Drone

In reply to LWP Cookies in Perl 5.8 by dataDrone

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.