sub inefficient_qx { my $cmd=shift; local *PIPE; open PIPE,"$cmd |" or die "Could not open pipe from $cmd"; # ^-- intentionally written using an old-style bareword handle for ancient perls if (wantarray) { my @tmp=; close PIPE or die "Close pipe failed: $!"; return @tmp; } else { my $tmp=do { local $/= }; close PIPE or die "Close pipe failed: $!"; return $tmp; } }