1 |
williamc |
1.1.2.1 |
#
|
2 |
|
|
# Runtime.pm
|
3 |
|
|
#
|
4 |
|
|
# Originally Written by Christopher Williams
|
5 |
|
|
#
|
6 |
|
|
# Description
|
7 |
|
|
# -----------
|
8 |
|
|
# Prepare a runtime environment
|
9 |
|
|
#
|
10 |
|
|
# Interface
|
11 |
|
|
# ---------
|
12 |
|
|
# new() : A new Runtime object
|
13 |
|
|
# file(file) : Specify an environment description file
|
14 |
|
|
# sh() : output environment to stdout in sh format
|
15 |
|
|
# csh() : output environment to stdout in csh format
|
16 |
|
|
|
17 |
|
|
package Runtime;
|
18 |
|
|
require 5.004;
|
19 |
|
|
use FileHandle;
|
20 |
|
|
|
21 |
|
|
sub new {
|
22 |
|
|
my $class=shift;
|
23 |
|
|
$self={};
|
24 |
|
|
bless $self, $class;
|
25 |
|
|
return $self;
|
26 |
|
|
}
|
27 |
|
|
|
28 |
|
|
sub file {
|
29 |
|
|
my $self=shift;
|
30 |
|
|
my $filename=shift;
|
31 |
|
|
|
32 |
|
|
$fh=FileHandle->new();
|
33 |
|
|
$fh->open("<".$filename);
|
34 |
|
|
while ( <$fh> ) {
|
35 |
|
|
}
|
36 |
|
|
undef $fh;
|
37 |
|
|
}
|
38 |
|
|
|
39 |
|
|
sub csh {
|
40 |
|
|
my $self=shift;
|
41 |
|
|
}
|
42 |
|
|
|
43 |
|
|
sub sh {
|
44 |
|
|
my $self=shift;
|
45 |
|
|
}
|