by mapgrep · 14y ago · 0 comments
open(my $fh, "<", "file.txt") or die "Error reading file: $!";
my @lines = <$fh>;
To slurp into a string rather than an array of lines: open(my $fh, "<", "file.txt") or die "Error reading file: $!";
my $s = join('',<$fh>);No comments yet.