http://www.perlmonks.org?node_id=994270


in reply to Re^2: CGI script connecting via terminal but not via browser
in thread CGI script connecting via terminal but not via browser

The PATH environment variable only affects which perl executable is used, if there happens to be more than one on the system. For instance, if you have /usr/local/bin/perl and /usr/bin/perl, the former will be picked up first by your shell, while the latter is used by your CGI. Two different perls, even if the same version, could have two different sets of modules and configurations. You could add which perl to my test CGI to report the full pathname of perl, and the results of perl -v will also show any differences in configs and the paths that perl checks for modules. If those match, then PATH doesn't matter beyond that.

Aaron B.
Available for small or large Perl jobs; see my home node.

Replies are listed 'Best First'.
Re^4: CGI script connecting via terminal but not via browser
by nkrgupta (Novice) on Sep 18, 2012 at 12:28 UTC

    Yes, the same perl interpreter is being used in both places. Might then be a security restriction as suggested by moritz above.