Skip to content
Browse files

check the return value of the open

  • Loading branch information...
1 parent 191a72c commit f0ea86459ccec6aa38921814c498e9e37f5d01fa @petdance committed
Showing with 1 addition and 2 deletions.
  1. +1 −2 t/first-and-last-lines-via-process-pipe.pl
View
3 t/first-and-last-lines-via-process-pipe.pl
@@ -9,8 +9,7 @@
my $files = File::Next::files( $input );
my $file = $files->();
-open my $f, '<', $file if defined $file;
-if ( $f ) {
+if ( open my $f, '<', $file ) {
my @lines = <$f>;
print $lines[0];
print $lines[-1];

0 comments on commit f0ea864

Please sign in to comment.
Something went wrong with that request. Please try again.