Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

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?

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (11)
As of 2015-12-01 13:42 GMT
Find Nodes?
    Voting Booth?

    My keyboard shows this many letters:

    Results (11 votes), past polls