Nah ja, heb het al op een andere manier opgelost:
#!/usr/bin/perl
use strict;
use warnings;
my $content;
my @a;
$content = qx{ ( LC_ALL=C /bin/cat /etc/apt/sources.list /etc/apt/sources.list.d/* 2>&1 ) };
foreach my $line ( split( '\n',$content ) )
{
if ( $line =~ /^deb / )
{
$line =~ s/ #.*$//g if $line =~ / #/;
@a = split( ' ',$line );
for ( my $i=3; $i<=$#a; $i++ ) { print "$a[2]/$a[$i] $a[1]\n"; }
}
}
Kun je het gebruiken, doe er je voordeel mee ;-)
Case closed for now.