Theo Van Dinter wrote:
On Sun, Jul 22, 2007 at 07:15:50AM -0000, [EMAIL PROTECTED] wrote:
Mark Perkel wrote:
If I have a string, what's that fastest way to count the number of periods in the string?

in perl, I would probably split the string at the periods

@parts = split /\./, $string;
and then just use the number of splits
$#parts

I believe the official/fastest/shortest method is:

$count = $string =~ y/.//;


OK - Thanks for your help on that one, Still need the DNS stuff figured out, That's the last piece in what will be an extrodinarilly powerful whitelisting system. I'll publish the code once it is tested. I think a lot of people will want to use it and improve it.

Reply via email to