docs: | Use L and L instead. my $strstr = substr( $haystack, index( lc $haystack, lc $needle ) ); Or a regex: my ( $strstr ) = $haystack =~ /(\Q$needle\E.*$)/si;