my @contents = do { open(my $fh, "/my/text/file") or die; <$fh> }; #### my @contents = do { local *ARGV; @ARGV=('/my/text/file'); <> };