freelanceprogrammers.org Forum Index » Perl

Help with creating registry keys.


View user's profile Post To page top
cljokla Posted: Sat Jul 17, 2004 11:25 pm


Joined: 19 Jul 2004

Posts: 4
Help with creating registry keys.
Hello,

I`m a NetAdmin and I use Perl to automate various tasks. I am
currently trying to get it to create registry keys so I can push out
an update, but I keep getting an error that`s confusing me. Here`s
the error and a short script I wrote as a test.

ERROR:
Modification of a read-only value attempted at
C:/perl/site/lib/Win32/Registry.pm line 228.

SCRIPT:
use Win32::Registry;
$HKEY_LOCAL_MACHINE->Open($root, "SOFTWARE\cj");
#I manually created the cj key in regedit.
$root->Create($newkey, "testkey");
$root->Close;
Reply with quote
Send private message
View user's profile Post To page top
cljokla Posted: Mon Jul 19, 2004 1:27 am


Joined: 19 Jul 2004

Posts: 4
Help with creating registry keys.
I solved my own problem. I had the variables backwards!

The create line should have been:

$root->Create("testkey", $newkey);

FYI...

Chris

--- In perl_official@yahoogroups.com, "Chris" <chrisj01@s...> wrote:
> Hello,
>
> I`m a NetAdmin and I use Perl to automate various tasks. I am
> currently trying to get it to create registry keys so I can push out
> an update, but I keep getting an error that`s confusing me. Here`s
> the error and a short script I wrote as a test.
>
> ERROR:
> Modification of a read-only value attempted at
> C:/perl/site/lib/Win32/Registry.pm line 228.
>
> SCRIPT:
> use Win32::Registry;
> $HKEY_LOCAL_MACHINE->Open($root, "SOFTWARE\cj");
> #I manually created the cj key in regedit.
> $root->Create($newkey, "testkey");
> $root->Close;
Reply with quote
Send private message
Post new topic Reply to topic
Display posts from previous:   
 

All times are GMT
Page 1 of 1
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Freelace Website Designer - Customer web design and software building.
China Wholesale - Electronics Products
Character Studio - Tutorials and Help