in reply to Re^2: Setting values for undefined environment variables
in thread Setting values for undefined environment variables

And that's a problem why?

... print <<"EOT"; The environment variable $foo is: @{[ ENV( $foo ) ]} That is all. EOT ...

Replies are listed 'Best First'.
Re^4: Setting values for undefined environment variables
by Limbic~Region (Chancellor) on Oct 24, 2004 at 03:20 UTC
    Fletch,
    If we are going to get silly, why not get ridiculous?
    #!/usr/bin/perl use strict; use warnings; package magic; sub ENV { defined $ENV{$_[0]} ? $ENV{$_[0]} : 'undefined' }; sub TIEHASH {bless {}, $_[0]} sub STORE {} sub FETCH {ENV($_[1])} package main; tie my %magic , 'magic'; print <<"--"; $magic{PATH} $magic{FOOBAR} --

    Cheers - L~R