Menu

#120 sysread returning undef instead of 0

Development Branch
closed-fixed
9
2002-03-08
2002-02-28
No

The following code is having problems:

#!perl -wl
use LWP::Simple;
print LWP::Simple::get('http://pudge.net/Foo.pm');

It should print 'print "hi";\012'. However, it usually
returns a warning, '# Use of uninitialized value in
print.' I traced this to
LWP::Simple::_trivial_http_get(), where sysread() will
get all the data and stick it in $buf, but $n, which
should be 0 when there's no more data, ends up being
undef.

If this cannot be fixed immediately, I can fix
LWP::Simple to use the "full LWP" method instead of the
trivial method, which does seem to work reliably. But
that would just be masking the apparent sysread()
problem.

When going through the debugger in PP_sysread, length()
was always 0, and was being returned properly. Figures.
I blame quantum singularities.

Discussion

  • Chris Nandor

    Chris Nandor - 2002-03-08

    Logged In: YES
    user_id=3660

    Fixed in GUSI 2.2.2.

     
  • Chris Nandor

    Chris Nandor - 2002-03-08
    • status: open --> closed-fixed
     

Log in to post a comment.