- or download this
# Example 1
#
...
} else { # or
print "No match in our string for our pattern.\n"; # As you
+'ll see...
} # end
- or download this
while (<>) {
if (/brus/) {
print $_;
}
}
- or download this
# Example 2
#
...
} else {
print "No match in our string for our pattern.\n"; # As you
+'ll see...
} # end
- or download this
# Example 3
#
...
if (/brus/) { # Our pattern of brus
print "There, brus showed up.\n" ; # if pattern is found, print i
+t!
}
+ # end
- or download this
# example 4
#
...
if (s/bru*s/brus/) { # fixing it
print $_ ; # proving we
+fixed it.
}
- or download this
# example 5
#
...
if (/a/) {
print $_ ;
}
- or download this
# example 6
#
print "Hello" . ' ' . "world"; #Same as 'Hello world'
- or download this
# example 7
#
...
print $_ ;
}
#
- or download this
# example 8
#
...
if (/[q-zQ-Z]/) {
print $_ ;
}