in reply to Re: Problem installing CPAN modules
in thread Problem installing CPAN modules

the first returns an empty null and the second two throw "Use of uninitialized value".

So I guess my proxy is not set? This is strange, since I can surf and the previous downloads were seem to be fine. How should I set it?

p.s.
Please take a look at the update in my original post.

Thanks!

UPDATE

I export HTTP_PROXY=http://myproxy:8080

Now I get the correct proxy for the first 2 commands, but the one using sudo still returns "Use of uninitialized value"

Replies are listed 'Best First'.
Re^3: Problem installing CPAN modules
by Corion (Patriarch) on Jun 28, 2010 at 09:08 UTC

    So now you need to set that variable for the superuser as well. I usually do that by starting a shell as the superuser:

    sudo bash export HTTP_PROXY=... ... whatever ... # After leaving the shell, all changes are gone again

    You might want to leave it that way for security reasons, so you only consciously pull in a HTTP proxy. If that proxy needs to be used always anyway, you can also modify the .profile of the superuser to set the proxy by editing /root/.profile or /root/.bashrc or even globally for all users by editing /etc/profile or /etc/bashrc or wherever that resides.

      I can't get it to work on sudo for perl.
      vadmin@ubu1004:~$ sudo bash root@ubu1004:~# export HTTP_PROXY=http://myproxy:8080 root@ubu1004:~# echo $HTTP_PROXY http://myproxy:8080 root@ubu1004:~# sudo echo $HTTP_PROXY http://myproxy:8080 root@ubu1004:~# perl -wle 'print $ENV{HTTP_PROXY}' http://myproxy:8080 root@ubu1004:~# sudo perl -wle 'print $ENV{HTTP_PROXY}' Use of uninitialized value in print at -e line 1.

        You're starting another sudo shell within your first sudo shell. Each new shell starts with the fresh values. Within the first sudo shell, all commands (without sudo prepended) should work now.