Beefy Boxes and Bandwidth Generously Provided by pair Networks
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??


in reply to Re: Alternatives for index() ... substr() ?
in thread Alternatives for index() ... substr() ?

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.

  • Comment on Re^2: Alternatives for index() ... substr() ?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1204196]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (3)
As of 2024-04-24 18:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found