use File::Copy qw(copy); sysread(recordfile, $record, $record_length); copy( \*recordfile, \*newrecordfile );