#!/usr/bin/env perl use warnings; use strict; use Getopt::Std 'getopts'; our $VERSION = '0.01'; $Getopt::Std::STANDARD_HELP_VERSION = 1; getopts('qi', \my %opts) or die "Usage: $0 [-q] [-i] FILE(s)\n"; if ( !@ARGV || (!$opts{i} && $opts{q}) ) { warn "No actions to perform\n"; exit 1 } for my $file (@ARGV) { open my $ifh, '<:raw', $file or die "$file: $!"; my $data = do { local $/; <$ifh> }; close $ifh; if (not $opts{q}) { my $cr = () = $data=~/\x0D(?!\x0A)/g; my $lf = () = $data=~/(?:raw', $file or die "$file: $!"; print $ofh $data; close $ofh; } }