ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/SCRAM/src/Runtime.pm
(Generate patch)

Comparing COMP/SCRAM/src/Runtime.pm (file contents):
Revision 1.1.2.5 by williamc, Fri Apr 7 13:34:52 2000 UTC vs.
Revision 1.1.2.6 by williamc, Wed Apr 12 15:55:05 2000 UTC

# Line 41 | Line 41 | sub printenv {
41          my $shell=shift;
42  
43          foreach $var ( @{$self->{'varlist'}} ) {
44 <          $self->_printoutenv($shell,$var,$self->getvalue($var));
44 >          $self->_printoutenv($shell,$var,
45 >                $self->_expandvar($self->getvalue($var)));
46          }
47   }
48  
# Line 73 | Line 74 | sub getvalue {
74   }
75  
76   # ---- Support Routines
77 + sub _expandvar {
78 +        my $self=shift;
79 +        my $string=shift;
80 +
81 +        return "" , if ( ! defined $string );
82 +         $string=~s{
83 +                \$\((\w+)\)
84 +        }{
85 +          if (defined $ENV{$1}) {
86 +                $self->_expandvar($ENV{$1});
87 +          } else {
88 +                "\$".$1;
89 +          }
90 +        }egx;
91 +         $string=~s{
92 +                \$(\w+)
93 +        }{
94 +          if (defined $ENV{$1}) {
95 +                $self->_expandvar($ENV{$1});
96 +          } else {
97 +                "\$".$1;
98 +          }
99 +        }egx;
100 +        return $string;
101 + }
102 +
103   sub _path {
104          my $self=shift;
105          my @vals=@_;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines