Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^2: McAfee False Positive

by SavannahLion (Pilgrim)
on Apr 08, 2010 at 13:03 UTC ( [id://833528]=note: print w/replies, xml ) Need Help??


in reply to Re: McAfee False Positive
in thread McAfee False Positive

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

Replies are listed 'Best First'.
Re^3: McAfee False Positive
by Marshall (Canon) on Apr 13, 2010 at 12:02 UTC
    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__

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://833528]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (3)
As of 2024-04-16 15:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found