in reply to Re: I humbly ask for your help with parsing
in thread I humbly ask for your help with parsing

The main benefit of matured modules is they handle corner cases you might have overlooked. Your code would, I agree, work most of the time, but if you get an odd directory name with a slash in it, she fails:

$_ = '/usr/local/www/"something/other"/"This file/data thing.cfg"'; print "$1\n" if /.+\/(\w+)\//; www

Replies are listed 'Best First'.
Re^3: I humbly ask for your help with parsing
by Lennotoecom (Pilgrim) on Oct 31, 2013 at 00:33 UTC
    I agree, it's just,
    if the author's task is to thrash through some ordinary-named directories
    maybe he doesn't need all this module-stuff.
      Excellent point.

      So long as the OP also understands the potential risks, an informed decision can be made.

      I personally tend to over-engineer everything; I am convinced that I am the butt of the old joke about "sometimes you have to fire the engineer and ship the product".

      Sometimes the quick solution is sufficiently effective and, I begrudgingly admit, the better choice in far more circumstances than my instincts would have me believe.

        )