my @macall = qw(print @input); foreach $line (@macall) { if ($line =~ /C4:46:19:75:C1:55:\s+(\S+)/) { $id = $1; } } print "ID = $id"; return (0);