News for hackers. Stuff that matters.
Re:Python for Perl programmers by mapgrep on Tuesday April 03, 2012 @04:38PM (#3794714)
Slightly more idiomatic would be with a useful die (and a semicolon terminating the first line):

  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>);

There are no comments on this comment yet.