General Perl fixes

Unbreak the proxy being used outside the scope of its declaration, resolves #488 and fixes bug introduced by #491.
Fix the case where Perl as a dependency is listed as perl-perl, or potentially in Debian as libperl-perl depending on what happens with prefix stuff. Resolves unrelated question brought up in #510.