Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Fetching date

by davemabe (Monk)
on Jan 21, 2004 at 16:39 UTC ( #322940=note: print w/replies, xml ) Need Help??


in reply to Fetching date

If performance is going to be an issue, I would suggest using the much more efficient substr function. Of course, depending on the situation the difference may be neglible, but I've worked on projects where performance was a big issue and this spared me a significant amount of cycles.

Dave

Replies are listed 'Best First'.
Re: Re: Fetching date
by Limbic~Region (Chancellor) on Jan 21, 2004 at 17:14 UTC
    Dave,
    I am not sure I agree with you. The AM wants to fetch all data in a specific format. The substr function extracts a substring. Perhaps you were thinking of index? While I agree that index can often be faster than a regex when detecting the precence of a string within a larger string, it requires an exact substring and is not maleable as say the \w character class in a regex. That type of flexibility seems to be required to solve this problem.

    Cheers - L~R

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (3)
As of 2020-08-05 01:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which rocket would you take to Mars?










    Results (35 votes). Check out past polls.

    Notices?