For Programmers: Free Programming Magazines  


Home > Archive > PERL Beginners > August 2005 > Tie::Registry









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Tie::Registry
Tim Wolak

2005-08-30, 6:56 pm

Guys thanks for the help yesterday. I have one more question, can someone
have a look at my script and tell me why I'm not getting the value of the
key? The prints are just to prove to me that its working...

Thanks,
Tim

use strict;
use warnings;
use Win32::TieRegistry (Delimiter => '/');
my $path = "Software/Microsoft/Windows/CurrentVersion/Run";

my $host = "chill0031";
my $virval;
my $virusKey = $Registry->{"//$host/HKEY_LOCAL_MACHINE/$path"};

foreach my $entry(sort keys %{$virusKey}){
foreach ($entry) {
if ($entry =~ /haha/i){
print "Found virus entry!!!\n";
}
if ($entry !~ /haha/i){
print "No virus entry found.\n"
}

my $virval = $virusKey->GetValue($entry);
if ($virval =~ /haha/i){
print "I've finally found you!!!!\n";
}

print "$entry =>".$virusKey->{$entry};
print "\n";
}

}

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com