tr as an alternative to length.
$ perl -E ' > $str = qq{\t\t\tcol1\tcol2}; > $str =~ m{^(\t+)}; > $leadingTabs = $1 =~ tr{\t}{}; > say $leadingTabs;' 3 $
Cheers,
JohnGG
In reply to Re: Simple regex related problem
by johngg
in thread Simple regex related problem
by rachitmohta11
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |