{ local $/= \4096; binmode(INPUT); binmode(OUTPUT); while( ) { if( s/^.*?(\x0d\x0a)/$1/s ) { print OUTPUT $_; last; } } print OUTPUT $_ while ; }