in reply to Re^2: IO::Handles ... any good?
in thread IO::Handles ... any good?

Currently I only have this solution for a single file:

perl -pe '$_.="\n"' file1.txt > file1.new

It's untested but should read file1.txt and print the modified version into file1.new.

I have no idea, how to perform this with multiple files in one (simple) command.

You could still use a shell for loop to perform this upon several files...

# bash for FILE in *.txt; do perl -pe '$_.="\n"' $FILE > $FILE.new; done

Replies are listed 'Best First'.
Re^4: IO::Handles ... any good?
by ikegami (Patriarch) on Mar 22, 2009 at 19:32 UTC

    Windows shell would be

    for %q in (*.txt) do perl -pe"$_.=$/" "%q" > "%q.new"

    And a golfed version would be

    perl -nEsay # 5.10 perl -pe$_.=$/ # <5.10 Windows perl -pe'$_.=$/' # <5.10 bash