A program that uses the -0 option.
#!/usr/local/bin/perl -0040 while ($line = <>) { $line =~ s/\n//g; next if ($line eq ""); print ("$line\n"); }