On Jul 14, P. Schaub said:

>is it possible to pass an array referenz 
>by an environment variable to another perl script ?

No.  The environment is not magical like that -- the place in memory of
the reference in program A is not special to program B.

You'll have to send a serialized version somehow:

  # prog1
  use Data::Dumper;
  $ENV{ARRAY} = Dumper \@array;

  # prog2
  @array = @{ eval $ENV{ARRAY} };

or:

  # prog1
  use Storable 'freeze';
  $ENV{ARRAY} = freeze \@array;

  # prog2
  use Storable 'thaw';
  @array = @{ thaw $ENV{ARRAY} };

There are many other serialization modules out there.  Search CPAN for
them.

-- 
Jeff "japhy" Pinyan      [EMAIL PROTECTED]      http://www.pobox.com/~japhy/
I am Marillion, the wielder of Ringril, known as Hesinaur, the Winter-Sun.
Are you a Monk?  http://www.perlmonks.com/     http://forums.perlguru.com/
Perl Programmer at RiskMetrics Group, Inc.     http://www.riskmetrics.com/
Acacia Fraternity, Rensselaer Chapter.         Brother #734
**      Manning Publications, Co, is publishing my Perl Regex book      **


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to