#! /usr/bin/perl
my @pkgs, $line;
open QUERY, "emerge --nospinner -ep gnome |"; foreach $line (<QUERY>) { $line =~ s/\[.+\] (.+) /$1/; chomp $line; print "${line}\n"; # $line =~ /(.+)\/(.+)-(\d.+)/; push @pkgs, $line; } close QUERY;
foreach $line (@pkgs) {
print "This is a package: $line\n";
}When I try to access @pkgs after this, there is no data in it. It prints 'This is a package: ' once and exits with no error. I know its getting the data correctly, because it prints a list of all the packages on the screen. What am I doing wrong?
-- Andrew Gaffney
-- [EMAIL PROTECTED] mailing list
