Hi,

i have a string:

my $str = "    hello  ";

i want to be able to count only the number of spaces at the START of the line

in the eg above there are 4 spaces at the start and 2 at the end

if i do something like:

my $i = () = $str =~ /^\s/;
print $i;

the result is: 1

any help would be appreciated.

regards
    Darren Edgerton

Reply via email to