my $regex = 'word'; my $regex2 = 'Word'; my $modifier = 'i'; my $string = 'a string that has Words in it';
print "match\n" if($string =~ s/$regex/$modifier/); print "match2\n" if($string =~ s/$regex2/$modifier/); You were missing the leading 's' for substitute and the final backslash. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/