Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
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 pondering the Monastery: (3)
As of 2014-09-20 15:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (160 votes), past polls