in reply to Use of a global scalar
our $text =~ s/$data[0]/$data[2]/g;You should note that $data[0] is interpreted as a regular expression, which is probably not what you want. This common error is often the cause of vulnerabilities. See "DON'T" in perlcheat and "\Q" in perlre.
In Section
Seekers of Perl Wisdom