in reply to Re: Re: Another dos to unix question
in thread Another dos to unix question

sub dos2unix { system( qq{perl -i -pe 's/\\cM*//g' $_} ) for @_ }

(No more inefficient than opening a pipe (?!?!) to mv rather than using unlink())

Replies are listed 'Best First'.
Re: Another dos to unix question
by Abigail-II (Bishop) on May 18, 2004 at 15:52 UTC
    Well, it's quite inefficient. You're starting a process for each file, and do a substitution for every empty string.
    sub dos2unix { system perl => '-i', '-pe' => 'tr/\x0D//d' @_ }

    Abigail