I’m doing a basic script with Perl and I’ve came across a problem with environment variables.
I need the %ALLUSERSPROFILE% variable (avaliable in ms-dos) but can’t find it in Perl. Is there any module or method to use all these variables avaliable in batch?
And here is the other question. Trying to solve the problem, I wanted to redirect the output of a ‘echo.%ALLUSERSPROFILE%’ in batch, but it didn’t work. Here is what I tried:
open (ENV, "echo.%ALLUSERSPROFILE%");
while (<ENV>) {
print "$_\n";
}
Any solution on this problem?
Thanks!
Environment variables are available as a hash
%ENV. So your particular variable is