Help for this page
sub foo { open FILE, "file.txt"; bar(); ... my @lines = <FILE>; # do something here }
sub foo { open my $file, "file.txt"; bar($file); ... my @lines = <$file>; # do something here }