use strict; use warnings; require 5.008_008; use Carp; use English qw( -no_match_vars ); [...] open my $fh, '-|', "$command" or carp "Error while executing command:$ERRNO\n"; my @command_output = <$fh>; close $fh or carp "ERROR: Couldn't close filehandle: $ERRNO\n";