$ perl -Mstrict -Mwarnings -MData::Dumper -e ' open my $xmlFH, q{<}, \ <; }; push @{ $_ =~ m{^http://} ? \ @comp : \ @fn }, $_ for $xmlText =~ m{$rx}g; print Data::Dumper->Dumpxs( [ \ @comp, \ @fn ], [ qw{ *comp *fn } ] );' @comp = ( 'http://a.b.co.uk/path/to/file.mp3', 'http://x.y.com/stuff.mp3', 'http://some.firm.com/downloads/glooble.mp3' ); @fn = ( 'file.mp3', 'stuff.mp3', 'glooble.mp3' ); $