good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
Re^2: Alternatives for index() ... substr() ?by Eily (Monsignor) |
on Nov 24, 2017 at 10:48 UTC ( [id://1204196]=note: print w/replies, xml ) | Need Help?? |
You understand the variable names right now, but if you do that often enough, you'll start using the same names to mean different things ($dl for download, destination length, desired language etc...) and will get more confusing. And you shouldn't rely on being able to remember what the names mean to understand the code. I'm glad that you understand the solution I proposed (rather than just copy and paste it), be aware that it is not perfect though. As Laurent_R said, if "copying" or "from" can be found somewhere else in the string (in the file names or the paths) the regex might use the wrong ones. The solutions proposed by choroba or Laurent_R might be better fitted in some cases. is it worth trying Parse::RecDescent?... Not for your problem (although it's a great tool in other cases). Sundial seems to like demonstrating that he has approximate knowledge of many things, so he favours being able to say a lot about something over relevance or even technical accuracy. Just ignore his posts.
In Section
Seekers of Perl Wisdom
|
|