# Here we're at the top level of a script open my $FH, '<', 'FileName' or die $!; while (<$FH>) { ... process lines ... } # Now we're sleeping for 5000 seconds, and FileName is still open, because the program still # has $FH accessible. sleep 5000