Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^3: Regex: Matching around a word(s)

by nothingmuch (Priest)
on Dec 17, 2005 at 19:54 UTC ( [id://517515]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Regex: Matching around a word(s)
in thread Regex: Matching around a word(s)

I wouldn't be weary of weight, unless you are running in a 1990s CGI environment (as opposed to mod_perl or FastCGI), for example.

This is due to two reasons. First of all, the efficiency difference will probably not be noticable unless benchmarked. The modules might even be more efficient than your regex stuff. Second, your time is worth more than the computer's time, as is the time of the maintenance programmer (you, or some other guy) that will come after you, in a few weeks/months time. This has value that can be later invested in beefier hardware. Unless the performance of the code is a problem (more over - a measurable problem), don't worry about it.

This is just an opinion though, grain of salt, 2 cents, and all.

-nuffin
zz zZ Z Z #!perl

Replies are listed 'Best First'.
Re^4: Regex: Matching around a word(s)
by shotgunefx (Parson) on Dec 18, 2005 at 00:14 UTC
    I'm not opposed to modules by any means. Though usually, for something small like this, I'd rather not introduce more dependencies.

    If there was something on CPAN that did what I was looking for, I would have just used it.

    As it stands, there's not. Which has provided some nice mental exercise. Which is good because I've been a tad stagnant. Outside of some software for my car, seems like I've been doing the same thing over and over forever.

    -Lee

    perl digital dash (in progress)
Re^4: Regex: Matching around a word(s)
by BrowserUk (Patriarch) on Dec 17, 2005 at 20:10 UTC

    I'd love to see a solution that used Text::ExtractWords and Text::Sentence (There's no link because I cannot find a module by that name?). I just cannot see how the former would be used for this?


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.
      I have no clue how to do that either ;-)

      I just commented for the psychological good of it, or something.

      -nuffin
      zz zZ Z Z #!perl

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (6)
As of 2024-03-28 18:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found