Blob


1 #!/usr/bin/perl
3 # Using the pattern test program, make a pattern to match the string 'match'.
4 # Try the program with the input string 'beforematchafter'. Does the output
5 # show the three parts of the match in the right order?
7 use warnings;
8 use strict;
9 use utf8;
11 while (<>) {
12 chomp();
13 if (/match/) {
14 print "Matched: |$`<$&>$'|\n";
15 } else {
16 print "No match: |$_|\n";
17 }
18 }