- #!/usr/bin/env perl
- use strict;
- use warnings;
- foreach my $f (@ARGV) {
- local($/);
- if (!open(F, "<", $f)) {
- print STDERR "Can't open $f for readingn";
- exit 1;
- }
- print "Converting $f...n";
- binmode F;
- my $data = <F>;
- close(F);
- if (!open(F, ">", $f)) {
- print STDERR "Can't open $f for writingn";
- exit 1;
- }
- binmode F;
- $data =~ s/rn/n/sg;
- $data =~ s/n/rn/sg;
- print F $data;
- close(F);
- }