http://qs321.pair.com?node_id=279711
Category: text processing
Author/Contact Info hash h4sh@globo.com
Description: Code usefull to edit files automaticly removing the last "." in the selected string lines.
#!/usr/bin/perl 
# Get files and skip "." in the selected strings.
# jeffa is right. killlastdot.pl :)
# Usage: ./killlastdot <ENTER> file word

my $FILE = <STDIN> ;
chop $FILE ;
my $VAR = <STDIN> ;
chop $VAR ;
open(GETARQ, "$FILE") ;
my @ARQ = <GETARQ> ;
close(GETARQ) ;
        foreach (@ARQ) {
                if ($_=~/$VAR/) {
                        my $x = $_ ;
                        chop($x) ;
                        chop($x) ;
                        print "$x\n" ;
                        }
        else
        {
        print $_ ;
        }
}