yitzle wrote:
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.
\ is a backslash, not /.
John
--
Perl isn't a toolbox, but a small machine shop where you
can special-order certain sorts of tools at low cost and
in short order. -- Larry Wall
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/