#!/usr/bin/perl use warnings; use strict; use feature qw{ say }; use XML::DOM; my $doc = 'XML::DOM::Parser'->new->parsefile(shift); say $_->getAttribute('id') for grep 3464 eq $_->getAttribute('sigid'), $doc->getElementsByTagName('signal');