Jul 15, 2016, 4:10 AM
Post #2 of 4
Quite a few problems in your code. Just identifying a few here below.
Re: [cjosemaria] download data from web
[In reply to]
You have strange spacing in many places, and it will not work in the regular expressions of your substitutions.
Then your pattern iof looking for "a ratings", which appears nowhere in your HTML string, and is therefore bound to fail.
In a regex, the star ("*") is a quantifier applied to the previous letter and does not do what you presumably think.
You seem to look for a "gif" extension, but there is nothing such in your HTML source string.
Finally, although it can sometimes be done for very very simple cases, it is usually considered that using regexes to parse HTML is a bad idea. You should probably use a CPAN module to parse your HTML. See some possibilities here: https://www.google.fr/search?q=cpan+html&ie=utf-8&oe=utf-8&client=firefox-b&gfe_rd=cr&ei=KsSIV8OEJKKx8wfO4p3IBQ.