I haven't yet gotten to the point of running it from cron; so far I'm still testing it on the command line, but it's successfully writing these files, so permissions don't seem to be a problem.

I have the minimal test reading successfully from cURL, and doing everything that the main script is doing to the Parser object.

#!/usr/bin/perl use strict; use Data::Dumper; use Net::Curl::Easy qw(:constants); use XML::RSS::Parser; my $ua_string = "User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; r +v:30.0) Gecko/20100101 Firefox/30.0"; my $curl = Net::Curl::Easy->new; my $feedsrc = "https://feeds.simplecast.com/o4MKcfjK"; my $feed; $curl->pushopt(CURLOPT_HTTPHEADER, [$ua_string]); $curl->setopt(CURLOPT_NOPROGRESS, 0); $curl->setopt(CURLOPT_FOLLOWLOCATION, 1); $curl->setopt(CURLOPT_CONNECT_ONLY, 0); $curl->setopt(CURLOPT_URL, $feedsrc); $curl->setopt(CURLOPT_WRITEDATA, \$feed); $curl->perform(); my $parser = XML::RSS::Parser->new(); $parser->register_ns_prefix('lc_itunes', 'http://www.itunes.com/dtds/p +odcast-1.0.dtd'); my $rss = $parser->parse_string($feed); print $rss . "\n";
Which results in:
$ ./test.pl % Total % Received % Xferd Average Speed Time Time Time + Current Dload Upload Total Spent Left + Speed 100 164k 100 164k 0 0 1267k 0 --:--:-- --:--:-- --:--: +-- 1271k XML::RSS::Parser::Feed=HASH(0x618af3317380)

So that's working. I just can't see why it's breaking as part of the actual script, when it's clearly readable in isolation, and works fine on a different machine.


In reply to Re^4: RSS Parsing not working on new machine by wintermute115
in thread RSS Parsing not working on new machine by wintermute115

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.