#!/usr/bin/perl use warnings; use strict; -t && exec "/bin/cat"; undef $/; my $in = <>; $in =~ s/^.*\r(?!\n)//gm; print $in;