#!perl -w use strict; # loop through the file while (<>) { print }; #### if (/^Article\b/) { s/\s*$//; # remove trailing whitespace and newlines print "Line [$_] is a heading."; }; #### $_ = "Article 1 News"; print "\\subsection*{$_}";