Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^2: port a function from php

by oiskuu (Pilgrim)
on Dec 10, 2013 at 17:22 UTC ( #1066474=note: print w/ replies, xml ) Need Help??


in reply to Re: port a function from php
in thread port a function from php

Well... Consider this perl code for example:

sub ncp { ($_[0] ^ $_[1]) =~ m/\0*/; $+[0]; }
This returns the common prefix length for two given strings. Except when it fails, that is. Which happens when NUL's are present in the (longer) string. A case that has actually bitten me before. The PHP semantics would be a win sometimes.


Comment on Re^2: port a function from php
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (7)
As of 2014-07-11 10:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (224 votes), past polls