in reply to Shell/Perl Variables

If you're always going to use the same environment variables, consider reading them directly in your Perl program rather than off the command line:
my $filename = $ENV{MYFILENAME}; my $companyid = $ENV{COMPANYID};
etc.

If you post the code you're using to process @ARGV, there may be a problem that someone here can spot and help with.

HTH

Replies are listed 'Best First'.
Re:x2 Shell/Perl Variables
by grinder (Bishop) on Jun 28, 2001 at 01:19 UTC

    Depending on whether the environment variables are exported or not, your suggestion might not work:

    % FOO=bar % echo $FOO bar % perl -le 'print shift' $FOO bar % perl -le 'print $ENV{FOO}' %

    --
    g r i n d e r
      In the original example, the shell script was called from elsewhere, and the variables were setup outside of the shell. So, whether the shell exports variables or not is irrelevant.

      -- Abigail