$myfile =~ s!([A-Z]+)!$1!g; #### $ perl -lwe '$_="hi MOM and DAD"; print; s!([A-Z]+)!$1!g; print' hi MOM and DAD hi MOM and DAD #### $myfile =~ s!\b([A-Z]+)\b!$1!g; #### perl -i~ -plwe 's/mom/dad/g' *.txt #### open my $fh, "source-data.txt" or die "opening source-data.txt: $!"; print "
\n"; while ( my $line = <$fh> ) { # protect against most egregious HTML violations $line =~ s/&/&/g; $line =~ s//>/g; # mark upper-case words as italic. not locale-safe. $line =~ s!\b([A-Z])+\b!$1!g; # output the result print $fh $line; } print $fh "
\n"; close $fh or die "closing source-data.txt: $!"; ##
## while ( <$fh> ) { # protect against most egregious HTML violations s/&/&/g; s//>/g; # mark upper-case words as italic. not locale-safe. s!\b([A-Z])+\b!$1!g; # output the result print $fh $_; }