You don't show us the code you have already written. This makes it hard for us to suggest you ways to improve your code.
You could use the following code, but it's likely even less efficient than a loop:
my $string = "\t\t\tfoo\t\tbar"; $string =~ s/^(\t+).*/$1/; $string =~ s/\t/+1/g; print eval $string, " tabs";
In reply to Re: Simple regex related problem
by Corion
in thread Simple regex related problem
by rachitmohta11
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |