Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: SUBSTR OR REGEX: WHICH WILL YOU FAVOUR?

by BrowserUk (Patriarch)
on Oct 19, 2013 at 20:16 UTC ( [id://1058942]=note: print w/replies, xml ) Need Help??


in reply to SUBSTR OR REGEX: WHICH WILL YOU FAVOUR?

Is the benchmark module broke or something? lol!!

Yes. lol!!

print $1 while 'abcdefghijkl' =~ m[(.{3})]g;; abc def ghi jkl use constant LEN => 3;; print $1 while 'abcdefghijkl' =~ m[(.{LEN})]g;; ## notable absence of output mean the regex matched nothing (very, ver +y quickly).

With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

Replies are listed 'Best First'.
Re^2: SUBSTR OR REGEX: WHICH WILL YOU FAVOUR?
by Anonymous Monk on Oct 19, 2013 at 20:33 UTC

    Nice catch BrowserUk! You know I didn't even border to test the changed made on the regex to see the output.
    I think this is why is good to be paranoid some of the time, especially, when your pre-informed mind is called to question by new discovery! lol!!
    So, substr still carry the day!!!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1058942]
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-04-24 12:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found