in reply to matching a defined lenght

A string won't always function as a regexp to find itself. What people mean by using substr instead is to do something like:
sub subpos { # find the offset of any substring my ( $checkstring, $substring ) = @_; my $length = length( $substring ); my $limit = length( $checkstring ) - $length; for ( my $i = 0; $i < $limit; $i++ ) { ( substr( $checkstring, $i, $length ) eq $substring ) and return $i; } undef(); # or alternatively return -1 for not found }
length.
__________________________________________________________________________________

^M Free your mind!