while (<>) { next unless /^##/; my $key = substr $_, 19, 10; do_stuff_with($key); }