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

Re: OT: eregi deprecated

by tobyink (Abbot)
on Mar 16, 2013 at 06:52 UTC ( #1023816=note: print w/ replies, xml ) Need Help??


in reply to OT: eregi deprecated

eregi("\n", $youremail) becomes preg_match("/\n/", $youremail).

But personally, I'd replace this:

!eregi("\r",$youremail) && !eregi("\n",$youremail)

With this, because strpos is faster than a regexp:

strpos("\r",$youremail)===FALSE && strpos("\n",$youremail)===FALSE

Or even (it'll probably be faster, but it's slightly obscure):

strpos("\r",$youremail)===strpos("\n",$youremail)
package Cow { use Moo; has name => (is => 'lazy', default => sub { 'Mooington' }) } say Cow->new->name


Comment on Re: OT: eregi deprecated
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (4)
As of 2014-09-20 15:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (160 votes), past polls