#!/usr/bin/perl -w
use strict;
my $text = "this text";
$text =~ /this/that; #### WRONG syntax #####
print $text;
#------
Bareword found where operator expected at C:\TEMP\temp1.pl line 5,
near "/this/that"
(Missing operator before that?)
syntax error at C:\TEMP\temp1.pl line 5, near "/this/that"
Execution of C:\TEMP\temp1.pl aborted due to compilation errors.
===============================================
#!/usr/bin/perl -w
use strict;
my $text = "this text";
$text =~ s/this/that/; #note s needed as well as '/' after "that"
print $text;
#prints: that text
####
my $text = "this text";
print $text =~ /this/;
####
#match can be used like a boolean T/F
if($text =~ m/this/)
{ blah ...}