#!/usr/bin/perl use warnings; use strict; use feature qw{ say }; say $$; sleep 10; my $file = shift; open my $FH, '<', $file or die $!; my $string; { local $/; $string = <$FH> }; say length $string; sleep 1; undef $string; seek $FH, 0, 0; $string = do { local $/; <$FH> }; say length $string;