# One-liners; different than the other Monks, but not better. my $pos = length( (split /\*/, $str)[0] ); my $pos = ( $str =~ m{ \A ( [^*]+ ) }x ) ? length($1) : 0;