It was Thursday, June 19, 2003 when Jeff Westman took the soap box, saying:
: I am trying to see what variables are set in my (parent) environment.
: The following gives me an error:
:
: 1 #!/bin/perl -w
: 2
: 3 @a = qx{set};
: 4
: 5 print foreach (@a);
: 6
:
: Error message:
: Can't exec "set": No such file or directory at ./x line 3.
:
: Yet, using qx{env} works fine. Why?
This is not authoritative, but I believe the problem may be that 'set'
is a shell builtin, while env is a real program in your path.
My question is, why not use %ENV?
printf "%s=%s\n", $_, $ENV{$_} foreach keys %ENV;
Casey West
--
Shooting yourself in the foot with APL
@#&^$%&%^ foot
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]