seek( $IN1, 0, SEEK_END ); my $length = tell($IN1); seek( $IN1, 0, 0 );