File::Scan - Perl extension for Scanning files for Viruses |
File::Scan - Perl extension for Scanning files for Viruses
use File::Scan;
$fs = File::Scan->new([, OPTION ...]); $fs->set_callback( sub { my $filename = shift; my $bytes = shift; ... return("Callback Value"); } ); $fs->scan([FILE]); if(my $e = $fs->error) { print "$e\n"; } if(my $c = $fs->skipped) { print "file skipped ($c)\n"; } if($fs->suspicious) { print "suspicious file\n"; } if(my $res = $fs->callback) { print "$res\n"; }
This module is designed to allows users to scan files for known viruses. The purpose is to provide a perl module to make plataform independent virus scanners.
This method create a new File::Scan object. The following keys are available:
scan([FILE])
This method scan a file for viruses and return the name of virus if a virus is found.
set_callback([SUBREF])
This method is another way to install a callback subroutine reference. Take a look in callback kay.
skipped()
This method return a code number if the file was skipped and 0 if not. The following skipped codes are available:
suspicious()
This method return 1 if the file is suspicious and 0 if not.
callback()
This method return the result from the callback subroutine.
error()
This method return a error message if a error happens.
Henrique Dias <hdias@aesbuc.pt>
Thanks to Rui de Castro, Sergio Castro, Ricardo Oliveira, Antonio Campelo, Branca Silveira, Helena Gomes and Anita Afonso for the help.
Thanks to Fernando Martins for the personal collection of viruses.
perl(1).
File::Scan - Perl extension for Scanning files for Viruses |