Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Odd LWP Problem

by kennethk (Abbot)
on May 03, 2017 at 19:56 UTC ( #1189443=note: print w/replies, xml ) Need Help??


in reply to Odd LWP Problem

I concur with choroba that it's odd. I see no difference under Perl 5.22 ActiveState (or 5.20):
This is perl 5, version 22, subversion 1 (v5.22.1) built for MSWin32-x +86-multi-t hread-64int (with 1 registered patch, see perl -V for more detail) Copyright 1987-2015, Larry Wall Binary build 2201 [299574] provided by ActiveState http://www.ActiveSt +ate.com Built Dec 24 2015 12:36:28
But get an unhandled exception under 64-bit ActiveState 5.22 and 5.24:
This is perl 5, version 22, subversion 1 (v5.22.1) built for MSWin32-x +64-multi-t hread (with 1 registered patch, see perl -V for more detail) Copyright 1987-2015, Larry Wall Binary build 2201 [299574] provided by ActiveState http://www.ActiveSt +ate.com Built Jan 4 2016 12:12:58 ... This is perl 5, version 24, subversion 0 (v5.24.0) built for MSWin32-x +64-multi-t hread (with 1 registered patch, see perl -V for more detail) Copyright 1987-2016, Larry Wall Binary build 2400 [300558] provided by ActiveState http://www.ActiveSt +ate.com Built Jun 9 2016 21:44:59
and it happens for this reduced example:
#! /usr/bin/perl use strict; use warnings; use LWP::Simple; open my $inf, "<", "temp.txt" or die; #This line no longer generates a + warning. while (<$inf>) { #while (<DATA>) { my $html = getprint("https://clio.columbia.edu/catalog?q=How%20to% +20conduct%20your%20own%20survey%20&search_field=title_starts_with&f%5 +B-format%5D%5B%5D=Online&commit=Search") or die; } exit; __DATA__ How to conduct your own survey / Priscilla Salant and Don A. Dillman.
Given that I'm seeing something slightly different, can you verify you still see the issue for this posted code? Otherwise, can you edit your code down at all and still see bad behavior?

#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.

Replies are listed 'Best First'.
Re^2: Odd LWP Problem
by mdkoehn (Novice) on May 04, 2017 at 17:12 UTC

    OK, I've cut out all of the code that does anything. The following, despite doing nothing with the value read from the file, still fails

    #! /usr/bin/perl use strict; use warnings; use LWP::Simple; open INFIL, "temp.txt" or die; while (<INFIL>) { #while (<DATA>) { my $html = getprint("https://clio.columbia.edu/) or die; } exit; __DATA__ How to conduct your own survey / Priscilla Salant and Don A. Dillman.

    I have a workaround for now -- I dumped all 40,000+ lines to be processed in the DATA section. Still, it would be nice to figure out if this is user error (doubtful at this point), or, if it's a perl-related bug, get it fixed.

    By the way, here's the perl -V for the cygwin perl:

    $ perl -V Summary of my perl5 (revision 5 version 22 subversion 3) configuration +: Platform: osname=cygwin, osvers=2.6.1(0.30553), archname=cygwin-thread-multi uname='cygwin_nt-6.3 cygwin 2.6.1(0.30553) 2016-12-16 11:55 x86_64 + cygwin ' config_args='-des -Dprefix=/usr -Dmksymlinks -Darchname=x86_64-cyg +win-threads -Dlibperl=cygperl5_22.dll -Dcc=gcc -Dld=g++ -Accflags=-gg +db -O2 -pipe -Wimplicit-function-declaration -fdebug-prefix-map=/mnt/ +share/maint/perl.x86_64/build=/usr/src/debug/perl-5.22.3-1 -fdebug-pr +efix-map=/mnt/share/maint/perl.x86_64/src/perl-5.22.3=/usr/src/debug/ +perl-5.22.3-1 -fwrapv' hint=recommended, useposix=true, d_sigaction=define useithreads=define, usemultiplicity=define use64bitint=define, use64bitall=define, uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='gcc', ccflags ='-DPERL_USE_SAFE_PUTENV -D_GNU_SOURCE -U__STRIC +T_ANSI__ -ggdb -O2 -pipe -Wimplicit-function-declaration -fdebug-pref +ix-map=/mnt/share/maint/perl.x86_64/build=/usr/src/debug/perl-5.22.3- +1 -fdebug-prefix-map=/mnt/share/maint/perl.x86_64/src/perl-5.22.3=/us +r/src/debug/perl-5.22.3-1 -fwrapv -fno-strict-aliasing -fstack-protec +tor-strong -D_FORTIFY_SOURCE=2', optimize='-O3', cppflags='-DPERL_USE_SAFE_PUTENV -D_GNU_SOURCE -U__STRICT_ANSI__ - +ggdb -O2 -pipe -Wimplicit-function-declaration -fdebug-prefix-map=/mn +t/share/maint/perl.x86_64/build=/usr/src/debug/perl-5.22.3-1 -fdebug- +prefix-map=/mnt/share/maint/perl.x86_64/src/perl-5.22.3=/usr/src/debu +g/perl-5.22.3-1 -fwrapv -fno-strict-aliasing -fstack-protector-strong +' ccversion='', gccversion='5.4.0', gccosandvers='' intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678 +, doublekind=3 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=1 +6, longdblkind=3 ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', + lseeksize=8 alignbytes=8, prototype=define Linker and Libraries: ld='g++', ldflags =' -Wl,--enable-auto-import -Wl,--export-all-sym +bols -Wl,--enable-auto-image-base -fstack-protector-strong' libpth=/usr/lib libs=-lpthread -lgdbm -ldb -ldl -lcrypt -lgdbm_compat perllibs=-lpthread -ldl -lcrypt libc=/usr/lib/libcygwin.a, so=dll, useshrplib=true, libperl=cygper +l5_22.dll gnulibc_version='' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' ' cccdlflags=' ', lddlflags=' --shared -Wl,--enable-auto-import -Wl +,--export-all-symbols -Wl,--enable-auto-image-base -fstack-protector- +strong' Characteristics of this binary (from libperl): Compile-time options: HAS_TIMES MULTIPLICITY PERLIO_LAYERS PERL_DONT_CREATE_GVSV PERL_HASH_FUNC_ONE_AT_A_TIME_HARD PERL_IMPLICIT_CONTEXT PERL_NEW_COPY_ON_WRITE PERL_PRESERVE_IVUV PERL_USE_SAFE_PUTENV USE_64_BIT_ALL USE_64_BIT_INT USE_ITHREADS USE_LARGE_FILES USE_LOCALE USE_LOCALE_COLLATE USE_LOCALE_CTYPE USE_LOCALE_NUMERIC USE_LOCALE +_TIME USE_PERLIO USE_PERL_ATOF USE_REENTRANT_API Built under cygwin Compiled at Jan 15 2017 13:11:06 %ENV: PERL5LIB="/home/mdk2126/perl5/lib/perl5" PERL_LOCAL_LIB_ROOT="/home/mdk2126/perl5" PERL_MB_OPT="--install_base "/home/mdk2126/perl5"" PERL_MM_OPT="INSTALL_BASE=/home/mdk2126/perl5" @INC: /home/mdk2126/perl5/lib/perl5/cygwin-thread-multi /home/mdk2126/perl5/lib/perl5 /usr/lib/perl5/site_perl/5.22/x86_64-cygwin-threads /usr/lib/perl5/site_perl/5.22 /usr/lib/perl5/vendor_perl/5.22/x86_64-cygwin-threads /usr/lib/perl5/vendor_perl/5.22 /usr/lib/perl5/5.22/x86_64-cygwin-threads /usr/lib/perl5/5.22 .

    And here's the same for Strawberry:

    O:\My Documents\ReCAP Transfer\perl>perl -V Summary of my perl5 (revision 5 version 24 subversion 1) configuration +: Platform: osname=MSWin32, osvers=6.3, archname=MSWin32-x86-multi-thread-64in +t uname='Win32 strawberry-perl 5.24.1.1 #1 Sun Jan 15 20:28:53 2017 +i386' config_args='undef' hint=recommended, useposix=true, d_sigaction=undef useithreads=define, usemultiplicity=define use64bitint=define, use64bitall=undef, uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='gcc', ccflags =' -s -O2 -DWIN32 -DPERL_TEXTMODE_SCRIPTS -DPER +L_IMPLICIT _CONTEXT -DPERL_IMPLICIT_SYS -fwrapv -fno-strict-aliasing -mms-bitfiel +ds', optimize='-s -O2', cppflags='-DWIN32' ccversion='', gccversion='4.9.2', gccosandvers='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=12345678 +, doubleki nd=3 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=1 +2, longdbl kind=3 ivtype='long long', ivsize=8, nvtype='double', nvsize=8, Off_t='lo +ng long', lseeksize=8 alignbytes=8, prototype=define Linker and Libraries: ld='g++', ldflags ='-s -L"C:\perl\perl\lib\CORE" -L"C:\perl\c\lib" +' libpth=C:\perl\c\lib C:\perl\c\i686-w64-mingw32\lib C:\perl\c\lib\ +gcc\i686-w 64-mingw32\4.9.2 libs=-lmoldname -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 +-ladvapi32 -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid -lws2_32 -lmpr -lwinmm + -lversion -lodbc32 -lodbccp32 -lcomctl32 perllibs=-lmoldname -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdl +g32 -ladva pi32 -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid -lws2_32 -lmpr -lw +inmm -lver sion -lodbc32 -lodbccp32 -lcomctl32 libc=, so=dll, useshrplib=true, libperl=libperl524.a gnulibc_version='' Dynamic Linking: dlsrc=dl_win32.xs, dlext=xs.dll, d_dlsymun=undef, ccdlflags=' ' cccdlflags=' ', lddlflags='-mdll -s -L"C:\perl\perl\lib\CORE" -L"C +:\perl\c\l ib"' Characteristics of this binary (from libperl): Compile-time options: HAS_TIMES HAVE_INTERP_INTERN MULTIPLICITY PERLIO_LAYERS PERL_COPY_ON_WRITE PERL_DONT_CREATE_GVSV PERL_HASH_FUNC_ONE_AT_A_TIME_HARD PERL_IMPLICIT_CONTEXT PERL_IMPLICIT_SYS PERL_MALLOC_WRAP PERL_PRESERVE_IVUV USE_64_BIT +_INT USE_ITHREADS USE_LARGE_FILES USE_LOCALE USE_LOCALE_COLLATE USE_LOCALE_CTYPE USE_LOCALE_NUMERIC USE_LOCALE_TIME USE_PERLIO USE_PERL_ATOF Built under MSWin32 Compiled at Jan 15 2017 20:39:08 @INC: C:/perl/perl/site/lib/MSWin32-x86-multi-thread-64int C:/perl/perl/site/lib C:/perl/perl/vendor/lib C:/perl/perl/lib .

      Just picking nits, because, you know, Perl does:

      The updated code you posted does fail for me also, but works when I add the closing quote in the getprint() call:

      my $html = getprint("https://clio.columbia.edu/") or die; ^

      Any chance the "still doesn't work" could be a different error this time, and maybe, expecting failure, you didn't check the error message as closely?

      I know, it's a long shot, but, you know, pick all the nits, right?

      It looks like there may be an open ticket on this issue:

      https://github.com/libwww-perl/libwww-perl/issues/244

      Reading what's posted, my gut says they are unrelated, but who knows. Regardless, I would say you probably have enough to give the dev a good bug report.

      With regard to getting your work done, I agree that the dumb DATA block solution is the right one.


      #11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1189443]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2017-11-18 12:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:













    Results (277 votes). Check out past polls.

    Notices?