in reply to Re^2: RSS Parsing not working on new machine
in thread RSS Parsing not working on new machine
It looks like the builtin try is getting depreciated, so I'm not keen on using it long term. Having said that, swapping in use experimental 'try'; works (for most feeds; see above). Swapping in Try::Tiny gives me this new error:
syntax error at /home/ross/scripts/podcasts/podcasts.pl line 233, near + ") {" Execution of /home/ross/scripts/podcasts/podcasts.pl aborted due to co +mpilation errors.
This is the section it's complaining about:
try { $curl->pushopt(CURLOPT_HTTPHEADER, [$ua_string]); $curl->setopt(CURLOPT_PROGRESSFUNCTION, \&no_progress); $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(); } catch { $broken = 1; #putting next in here complains that it's exi +ting a subroutine } if (!defined($feed)) { # <--- Line 233 $broken = 2; }
I can't see an error there, and it doesn't throw one without Try::Tiny, so that seems pretty weird.
EDIT
OK, I figured that out. The Try::Tiny try/catch blocks need a closing semicolon. So now I have a robust try that won't go away in future versions of perl, and isn't somehow messing up all the feeds, but some are still getting messed up in ways I don't understand.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: RSS Parsing not working on new machine
by ikegami (Patriarch) on Apr 15, 2025 at 19:26 UTC | |
by wintermute115 (Acolyte) on Apr 15, 2025 at 20:46 UTC | |
by ikegami (Patriarch) on Apr 16, 2025 at 17:14 UTC | |
Re^4: RSS Parsing not working on new machine
by bliako (Abbot) on Apr 16, 2025 at 15:43 UTC |