Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hello, I'm using LWP::Simple to try and retrieve my bloglines unread count.

#!/usr/bin/perl use warnings; use strict; use LWP::Simple; my $url = "http://rpc.bloglines.com/update?user=my\@address.com&ver=1" +; getprint($url); my $unread_count = get($url); print "\nUnread string: $unread_count\n" if defined $unread_count;

It outputs

G:\incoming\home\perl>perl unreadtracker.pl |-1|| G:\incoming\home\perl>

so getprint seems to be working while get does not. It's Activestate 5.8.8 build 816 on XP with libwww-perl 5.805. Any ideas?

Replies are listed 'Best First'.
Re: getprint works but get doesn't
by Jobby (Monk) on Apr 07, 2006 at 21:01 UTC

    Oops, forgot to log in. Another thing, using http://slashdot.org or http://www.perlmonks.org for the $url *does* work.

      The server (rpc.bloglines.com) does not like the UserAgent value being sent by LWP::Simple when it's a trivial GET request. It sends "lwp-trivial/VERSION-NUMBER". A different value is used when you do get_old() or getstore() or getprint(): "LWP::Simple/VERSION-NUMBER". I'd call this a bug; whether it's a bug in LWP::Simple or in the server, I can't say for certain.

      Jeff japhy Pinyan, P.L., P.M., P.O.D, X.S.: Perl, regex, and perl hacker
      How can we ever be the sold short or the cheated, we who for every service have long ago been overpaid? ~~ Meister Eckhart
        I'm getting this problem too with This is perl, v5.10.1 built for MSWin32-x64-multi-thread (with 2 registered patches, see perl -V for more detail) Copyright 1987-2009, Larry Wall Binary build 1007 291969 provided by ActiveState http://www.ActiveState.com running on Windows 7, for url=http://www.dilbert.com/strips/comic/2010-03-04 Strange bug as surprised this is the first comment on it for some years. Naively, one would assume that getprint is just a get and then a print in some sense but clearly not.
      Use get_old() for now. Something's buggy.

      Jeff japhy Pinyan, P.L., P.M., P.O.D, X.S.: Perl, regex, and perl hacker
      How can we ever be the sold short or the cheated, we who for every service have long ago been overpaid? ~~ Meister Eckhart