#! perl -w use strict; use warnings; my $str = "Title: Learning Perl Author: Schwartz, Randal L. ISBN: xxxx"; if ( my ($title, $author, $isbn) = $str =~ /^Title: (.*)\s+Author: (.*)\s+ISBN: (.*)/ ) { $author =~ s/\.//g; # Remove full stops (periods) print "<$title><$author><$isbn>"; # Line 8 }