in reply to McAfee False Positive

It would probably be enough to keep the generated code in a separate file and leave the main script alone. You can extract the whole section into which you intend to insert code into a file and then require() it in the main script. That way you do not have to modify the script itself and thus should not trigger the antivirus.

Jenda
Enoch was right!
Enjoy the last years of Rome.

Replies are listed 'Best First'.
Re^2: McAfee False Positive
by SavannahLion (Pilgrim) on Apr 08, 2010 at 13:03 UTC

    That's kind of what I'm doing now, but I'll modify the code not to reference $0 and use some other name and see if that stops triggering McAfee. It's worth a looksee

      You can "read yourself" and write a newfile with perhaps modified contents of yourself, but you cannot write over yourself. I am running McAfee and the below works.
      #!/usr/bin/perl -w use strict; my $path = $0; print "reading: $path\n"; open (my $in, '<', $path) or die "cannot open $path"; open (my $out, '>', "$path.new") or die "cannot open \"$path.new\""; while (<$in>) { print; print $out $_; } __END__ from STDOUT: reading: C:\TEMP\scratch.pl #!/usr/bin/perl -w use strict; my $path = $0; print "reading: $path\n"; open (my $in, '<', $path) or die "cannot open $path"; open (my $out, '>', "$path.new") or die "cannot open \"$path.new\""; while (<$in>) { print; print $out $_; } __END__ from cat, i.e. type in Win lingo: C:\TEMP>cat scratch.pl.new #!/usr/bin/perl -w use strict; my $path = $0; print "reading: $path\n"; open (my $in, '<', $path) or die "cannot open $path"; open (my $out, '>', "$path.new") or die "cannot open \"$path.new\""; while (<$in>) { print; print $out $_; } __END__