Zentara wrote: > > Hi, Hello,
> I'm starting work on my own virus scanner. > > I tried File::Scan and was getting some sort of error, so > please don't tell me to use it. > > I started looking into the virus signature list at > openvirus.org, it looks something like this. > .... > ..... > VCS=b90f0489feac32c4aae2 > .... > .... > > Just a list of name=hexsignature, 1 per line > > So I thought about how I could do my own scanner, > I came up with this. I was wondering if anyone sees > flaws in my simple method, it seems to work for my test files. > Is there something I'm overlooking? > > I'm especially looking for ways to convert to hex more > efficiently, my $hexstring = '58354f2150254041505b345c505a'; my $hexlen = length( $hexstring ) / 2; my $hex = pack 'C*', unpack 'H' x $hexlen, $hexstring; > and whether grep would be better on big files, index() would probably be faster. > rather than using =~ m/ $hextest /i If you are going to use a regular expression you should quotemeta $hextest and you don't want to use /i or it might not match correctly. /\Q$hextest\E/ John -- use Perl; program fulfillment -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]