On Fri, 1 Dec 2000 [EMAIL PROTECTED] wrote:
> Hello,
>
> We are having a problem with a Perl script which has some hard-coded
> environment stuff in it. To work around the problem, there is a
> logical, $ENV{'DDSTARTUP'}, which points to a file, e.g.
> "DDSTARTUP:DDSETUP_ADV3.DAT", which has an environment definition in
> it. Our program needs to be modified to slurp up that file and use
> the environment definitions in there rather than (or, in addition to)
> in %ENV
You mention a logical accesible to perl via $ENV{'DDSTARTUP'} that points
to "DDSTARTUP:DDSETUP_ADV3.DAT" which seems to imply that the logical
DDSTARTUP is actually a logical directory (e.g. it might translate to
"DKA100:[DIR]"), unless DDSTARTUP is a search list or is defined
differently in two separate tables, in which case you'd have difficulty
with it even from DCL.
What is "an environment definition" in this context? Is it valid DCL?
Can you run:
$ @DDSTARTUP:DDSETUP_ADV3.DAT
and get the expecte logical names (in which case why is the file not
called "DDSTARTUP:DDSETUP_ADV3.COM")? Or is is a unix environment of the
var='value'
var2='another value'
variety? Or is it the output of a DCL command like:
$ show logical */output=DDSTARTUP:DDSETUP_ADV3.DAT
> Is there any VMSPerl tricks or sample scripts to access the contents
> of such an environment file, or do I need to just use brute force to
> parse it in?
You might profit from one looking into one of the parser modules on CPAN,
try e.g.:
http://search.cpan.org/search?mode=module&query=parse
there are also Text::* modules for doing balanced delimiter parsing above
and beyond what ordinary perl 5.005 style regexps can do.
A more narrowly focused recommendation might be possible with a better
specification of what "an environment file" actually contains.
Peter Prymmer