CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner: Re: [StarkRavingCalm] Editing remote registry help: Edit Log



FishMonger
Veteran / Moderator

Jan 9, 2014, 7:53 AM


Views: 7234
Re: [StarkRavingCalm] Editing remote registry help

Is this what you're looking for?

Code
#!/usr/bin/perl 

use warnings;
use strict;
use Win32::TieRegistry( Delimiter => '/', TiedHash => '%RegHash' );
use Data::Dumper;

my $path = 'HKEY_LOCAL_MACHINE/SYSTEM/ControlSet001/Services/Tcpip/Parameters/Interfaces';
my $interfaces = $RegHash{$path};

my %domain;
foreach my $interface (keys %$interfaces) {
$domain{$interface} = $interfaces->{$interface}{Domain};
}

print Dumper \%domain;


If you want the full path as the key, then adjust the assignment to this:

Code
$domain{"$path/$interface"} = $interfaces->{$interface}{Domain};



(This post was edited by FishMonger on Jan 9, 2014, 7:58 AM)


Edit Log:
Post edited by FishMonger (Veteran) on Jan 9, 2014, 7:58 AM


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives