};
}
-sub _gather_installed {
+sub _open_dpkg_query_pipe {
my ($self) = @_;
- my $command = "dpkg-query --show";
+ my $command = 'dpkg-query --show';
open my $pipe, '-|', $command
or die "Unable to open pipe to '$command': $!\n";
+ return $pipe;
+}
+
+sub _gather_installed {
+ my ($self) = @_;
+ my $pipe = $self->_open_dpkg_query_pipe;
my %package;
while (defined( my $line = <$pipe> )) {
chomp $line;