in reply to find the starting character position in a line
$line = " This is the test line"; if( $line =~ /(\S)/ ){ # match first non-space character print index($line, $1),"\n"; # find index } __END__ [download]