in reply to Finding location

See the index function - you'll have to handle the case of the substring not being found special but that shouldn't be much of a problem.

Replies are listed 'Best First'.
Re^2: Finding location
by Anno (Deacon) on Mar 09, 2007 at 20:14 UTC
    index can be persuaded to return the string length on non_match:
    my $pos = index( "$str*", '*');
    Anno