#!/usr/bin/perl use warnings; use strict; my $exe; my %hash; while (<>) { my ($quotas, $start, $finish) = split ' '; if (not defined $finish) { $exe = $quotas; <>; # Skip the following header. } else { $hash{$exe}{$quotas} = [ $start, $finish ]; } } print $hash{'ww.exe'}{def}[0];