Title: RE: Win32::AdminMisc::GetEnvVar

The hash containing the environmental variables is $List.

Try something like this:

Win32::AdminMisc::GetEnvVar(\%List, ENV_USER) || die "Cannot retrieve information.\n ";
print "$key --> $List{$key}\n" foreach $key (sort keys %List);

This function doesn't support remote machines.


Gary

-----Original Message-----
From: Christopher L. Severson [mailto:[EMAIL PROTECTED]]
Sent: Thursday, November 29, 2001 11:37 AM
To: '[EMAIL PROTECTED]'
Subject: Win32::AdminMisc::GetEnvVar


I am using this module/function to try and get all of the environment
variables from a REMOTE machine into a hash - is this possible?

I am currently trying this just for a local machine, and am getting an
error that states:
   'Odd number of elements in hash assignment at test5.pl line 24'

The code I am running is below:

use Win32::AdminMisc;

%envlist = ();
%List = ();


%envlist = Win32::AdminMisc::GetEnvVar(\%List, ENV_USER) || die "Cannot
retrieve information.\n ";

1)  What is wrong with my code?  After reading it from a couple of
different sources (www.roth.net being one of them) I am unable to get this
hash to populate

2)  Is it possible to use this to populate a hash full of variables from a
REMOTE machine?

Again, Thanks in Advance for any responses!

-Chris

_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-admin

Reply via email to