open FILE, 'test_file.txt' || die "$!\n"; my $text = join( '', @{ [ ] } ); close FILE; #### my $text; { open(my $fh, '<', 'test_file.txt') or die("Unable to open input file: $!\n"); binmode($fh); local $/; $text = <$fh>; }