#!/usr/bin/perl use strict; use warnings; die "USAGE:\n$0 \n" if @ARGV<3; my ($cnt,$fin,$fout)=@ARGV; open(my $ifh, '<:raw',$fin) or die "Error open $fin : $!\n"; <$ifh> while $cnt-- > 0; $/=undef; open(my $ofh, '>:raw',$fout) or die "Error open $fout : $!\n"; my $buff=''; print $fho $buff while(read $fh,$buff,4096); close $fho; close $ifh;