News for hackers. Stuff that matters.
Re:Python for Perl programmers by sciurus on Tuesday April 03, 2012 @03:07PM (#3794307)
Agreed, the trick with a local ARGV and the null filehandle is too clever. Don't copy code you don't understand! I think opening the file is much clearer.

    open( my $fh, '<', $file ) or die "cannot open $file\n";
    my $text = do { local( $/ ) ; <$fh> } ;

  http://perldoc.perl.org/perlopentut.html
  http://perldoc.perl.org/functions/do.html
  http://perldoc.perl.org/functions/local.html
  http://perldoc.perl.org/perlop.html#I%2fO-Operators

There are no comments on this comment yet.