1 ffd9a51f 2023-08-04 jrmu #!/usr/bin/perl
3 ffd9a51f 2023-08-04 jrmu # Using the pattern test program, make a pattern to match the string 'match'.
4 ffd9a51f 2023-08-04 jrmu # Try the program with the input string 'beforematchafter'. Does the output
5 ffd9a51f 2023-08-04 jrmu # show the three parts of the match in the right order?
7 ffd9a51f 2023-08-04 jrmu use warnings;
11 ffd9a51f 2023-08-04 jrmu while (<>) {
13 ffd9a51f 2023-08-04 jrmu if (/match/) {
14 ffd9a51f 2023-08-04 jrmu print "Matched: |$`<$&>$'|\n";
16 ffd9a51f 2023-08-04 jrmu print "No match: |$_|\n";