Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic

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 a soft breeze sighs...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (6)
As of 2017-12-15 22:13 GMT
Find Nodes?
    Voting Booth?
    What programming language do you hate the most?

    Results (443 votes). Check out past polls.