use XML::Simple; use strict; use warnings; use Data::Dumper; my $filename = 'channels.xspf'; my $title = 'tagesschau24'; my $library = XMLin($filename, ForceArray => [ 'track', 'location', 'extension', 'vlcoption'], KeyAttr => { track => 'title' } ); my $track = $library->{trackList}->{track}->{$title}; my $track2 = $library->{trackList}->{track}->{$title}->{extension}; #print Dumper $track; #print Dumper $track2; my @liste = (@{$track->{location}}); print "$liste[0]\n"; # gehe alle Einträge in @$track2 durch; sollte es eine (wahre) 'vlcoption' geben, # verwende sie; ansonsten mach nix my @liste2 = map { $_->{vlcoption} ? $_->{vlcoption} : () } @$track2; print "Dumper Ausgabe\n"; print Dumper @liste2; print "Inhalt von \@liste2\[0\]:\n"; print "$liste2[0]\n";