Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: (tye)Re: Sample Script

by simp (Novice)
on Jan 10, 2003 at 15:37 UTC ( #225828=note: print w/ replies, xml ) Need Help??


in reply to (tye)Re: Sample Script
in thread Sample Script to monitor Registry changes

I am using this in a windowless compile to monitor my pppoe ip and upload a modified html template to my providers web site. Works well, no leaks. This is the core of the script:

use Win32::TieRegistry qw( :REG_ :KEY_ ); $regkey = "Some_Registry_Key_Under_HKLM"; waitForChange(); sub waitForChange { $machKey= $Registry->Open( "LMachine", {Access=>KEY_READ(),Delimit +er=>"/"} ) or die( "Can't open HKEY_LOCAL_MACHINE key: $^E\n" ); $key = $machKey->Open($regkey) or die( "Can't open key: $^E\n" ); $TiedHashRef = $key->TiedRef; $TiedHashRef->RegNotifyChangeKeyValue( 1, REG_NOTIFY_CHANGE_LAST_S +ET, 0, 0 ); # block until key changes. # Key has changed... do something waitForChange(); # restart the change notifier } exit();


Comment on Re: (tye)Re: Sample Script
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (12)
As of 2015-07-28 08:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (254 votes), past polls