So... if I have a string that contains tabs both at the beginning and in the
middle, how do I just count the beginning ones?
I know that tr/// will return the number of matches in a string. My attempt
below results in $inittabcount being set to 6 (wrong), while $tabcount gets
correctly set to 5.
$test = "\t\t\tsasdfasdftill:\tin\tscope?";
$inittabcount = ($test =~ tr/^\t*?\w//);
$tabcount = ($test =~ tr/\t//);
print "inittabs = $inittabcount\n";
print "tabs = $tabcount\n";
Help?
Mike
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]