Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

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();

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 surveying the Monastery: (7)
As of 2016-10-21 09:29 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (288 votes). Check out past polls.