Blame


1 ffd9a51f 2023-08-04 jrmu #!/usr/bin/perl
2 ffd9a51f 2023-08-04 jrmu
3 ffd9a51f 2023-08-04 jrmu # Write a new program (*not* the test program!) that prints out any input
4 ffd9a51f 2023-08-04 jrmu # line ending with whitespace (other than just a newline). Put a marker
5 ffd9a51f 2023-08-04 jrmu # character at the end of the output line so as to make the whitespace
6 ffd9a51f 2023-08-04 jrmu # visible.
7 ffd9a51f 2023-08-04 jrmu
8 ffd9a51f 2023-08-04 jrmu use warnings;
9 ffd9a51f 2023-08-04 jrmu use strict;
10 ffd9a51f 2023-08-04 jrmu use utf8;
11 ffd9a51f 2023-08-04 jrmu
12 ffd9a51f 2023-08-04 jrmu while (<>) {
13 ffd9a51f 2023-08-04 jrmu chomp;
14 ffd9a51f 2023-08-04 jrmu if (/\s+\z/) {
15 ffd9a51f 2023-08-04 jrmu print ("Match: $_\$\n");
16 ffd9a51f 2023-08-04 jrmu }
17 ffd9a51f 2023-08-04 jrmu }