in reply to Re: Substitute array value in regular expression
in thread Substitute array value in regular expression

while(defined($_=<DATA>))
can be this:
while (<DATA>)

also check open() for error:

open(DOC,'sample_testing') or die "Can't open input file: $!";