#!/usr/perl -w use strict; my @interesting_lines = map { s[0010 0010.*//.*//][] ? $_ : ()} (); print "Name: $_" for @interesting_lines;