Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: Determining uniqueness in a string.

by ioannis (Abbot)
on Oct 01, 2005 at 01:01 UTC ( [id://496572]=note: print w/replies, xml ) Need Help??


in reply to Determining uniqueness in a string.

To speed things up, one easy step is to precompile the (static) pattern using the qr// operator, like qr/^\d{10}$/, or using the m//o flag, as in
die unless /^\d{10}$/o;
Also, the print statement might prove too expensive; perhaps, syswrite() is a better choice -- if you must write to output.

Replies are listed 'Best First'.
Re^2: Determining uniqueness in a string.
by sauoq (Abbot) on Oct 01, 2005 at 02:03 UTC

    No, using /o here isn't buying anything. And using syswrite() instead of print under the pretense of improving performance is probably misguided.

    -sauoq
    "My two cents aren't worth a dime.";
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (6)
As of 2024-04-18 13:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found