while () { chomp; my ($host, $log, $file) = split(/\|/); if ( $log eq 'ACTIVITY_LOG' and $file =~ s/^FILE //) { $host_access_files{$host} = $file; } # should put $host's activity log file name into # $host_access_files{$host} } # while WEB_FILE