Skip to content

Commit

Permalink
the rest of chapter 8
Browse files Browse the repository at this point in the history
  • Loading branch information
Napier-JP committed Oct 15, 2018
1 parent f0fba77 commit 7523c39
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
14 changes: 14 additions & 0 deletions ex8-5.pl
@@ -0,0 +1,14 @@
#!perl
use strict;
use warnings;
use utf8;

while(<>){
chomp($_);
if(m/\b(?<word>\w*a)\b(?<after>.{0,5})/){
print "Matched: 'word' contains '$+{word}'\n";
print "'after' contains '$+{after}'\n";
}else{
print "No match: |$_|\n";
}
}
11 changes: 11 additions & 0 deletions ex8-6.pl
@@ -0,0 +1,11 @@
#!perl
use strict;
use warnings;
use utf8;

while(<>){
chomp($_);
if(m/\s\z/){
print "'$_'";
}
}

0 comments on commit 7523c39

Please sign in to comment.