# chop $reqid; # use chomp chomp $reqid; #### while () { chomp; next unless /Task:id=(\d+)/; my $taskid = $1; next unless ($taskid eq $reqid); ## <-- add my (undef,$timestamp,undef) = split /\s+/,$_,3; ..