in reply to Re: port a function from php
in thread port a function from php
Well... Consider this perl code for example:
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.sub ncp { ($_[0] ^ $_[1]) =~ m/\0*/; $+[0]; }
In Section
Seekers of Perl Wisdom