use warnings; use strict; my $text = "I think there's a quote in here..\n"; my $p; substr( $text, $p - 1, 1 ) = '' while $p = index( $text, "'" ) + 1; print $text;