#!/usr/bin/perl # removenewlines.pl < file1 > file2 writes file1 into file2 with no newlines while () { chomp; print "$_"; }