my $value = 'not found'; while () { $value = $1, last if /TARGET\s?=\s?(\S*)\s/; }