ok, so as it turns out the one I have that seems to interact has some sort
of issue in doing the tests that is somewhere between hard and impossible
to determine without understanding win32::tieregistry better. in order to
learn it to understand it better, i decided to get the first one using
strict as some of the programmers here request in order to have good code.
here's is the current and previous issue I have
C:\Documents and Settings\jperlmutter.GRANITE_ENG\My
Documents\perl\test_scripts\SeaNotify>perl -w tsnt.pl -log trials.txt
-iter 1
Global symbol "$Registry" requires explicit package name at tsnt.pl line
119.
Global symbol "$Registry" requires explicit package name at tsnt.pl line
124.
Global symbol "$Registry" requires explicit package name at tsnt.pl line
126.
Execution of tsnt.pl aborted due to compilation errors.
C:\Documents and Settings\jperlmutter.GRANITE_ENG\My
Documents\perl\test_scripts\SeaNotify>perl -w tsnt.pl -log trials.txt
-iter 1
Can't call method "Delimiter" on an undefined value at tsnt.pl line 119.
and here's the relevant code through line 130. the ... is stuff i took out
dealing with handling passed options
#! /usr/bin/perl -w
use strict;
use Getopt::Long; # used in getting unix-style options
use Win32::TieRegistry (TiedHash => '%RegHash');
use POSIX;
use File::Copy "mv";
my(@watch, @vals, @members);
my($posix, $file, $key, $val, $iter, $done, $log, $regpth, $Registry);
my($help, $verb, $qrev, $rev, $revdat, $modules); # standard
options/revision information variables
$posix=0; $iter=0; $done=0; $log='';
$modules="\tnothing as of now\n\n"; $help=0; $qrev=0;
$rev="0.1"; $revdat="08/17/2005"; $verb=0;
open LOG, ">$log" or die "Cannot create $log: $!\n";
&rep("Sea Notify test started at ".localtime(), $verb);
############
# this section finds the registry key value for what is watched.
# first it queries the registery for them, then it imports them
# into an array. while it does this it drops the c:\windows\
# dirs for boot protection.
# we need the Win32::TieRegistry
# module via this module we get two items from the registry and
# then check them for files that we can modify that are not in a
# place that makes them sensitive to booting right (services)
# then place the values that are files into an array (@watch)
# which will be used later to test SeaNotify
# declaration of TieReg @ begining: use Win32::TieRegistry (TiedHash =>
'%RegHash');
&rep("Using Windows version of SeaNotify....registry interaction
started", $verb);
&rep("Setting Delimiter", $verb);
$Registry -> Delimiter('/');
&rep("Setting registry path short to
HKEY_LOCAL_MACHINE/System/CurrentControlSet/Services/",$verb);
$regpth="HKEY_LOCAL_MACHINE/System/CurrentControlSet/Services";
@members = $Registry->{"$regpth/SeaNotify"}->MemberNames;
@vals = $Registry -> {"$regpth/SeaNotify/"} ->
GetValue("/SeaNotifyFiles");
foreach $val (@vals){
if(-f $val){ push @watch,$val; }
}
I thought that $Registry was defined in Win32::TieRegistry, but I guess
it's something you inherit once you declare. I don't get the undefined
value error. can someone please explain the failure to me? is this
because of something in the module or in my code?
_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs