Peter:
Hi. The contents of one of these files look some kind of input files
to something which initialises the environment. It is not valid DCL
and not output from SHOW LOGICAL.
Upon looking at the content more, it looks like the important bits are
of the format:
<logical>\t:\t<value>\n
where <logical> is something which winds up being a logical, and the
value winds up being its value. I suspect it is something we did in
house, and there is some DCL parsing it (somewhere!), and the format
looks simple enough to tackle with one of the "Text" modules, or even
just plain perl.
Regards,
David Hansen
______________________________ Reply Separator _________________________________
Subject: Re: Environment definition files and Perl
Author: pvhp ([EMAIL PROTECTED]) at unix,mime
Date: 12/01/00 1:58 PM
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
Visit our website at http://www.ubswarburg.com
This message contains confidential information and is intended only
for the individual named. If you are not the named addressee you
should not disseminate, distribute or copy this e-mail. Please
notify the sender immediately by e-mail if you have received this
e-mail by mistake and delete this e-mail from your system.
E-mail transmission cannot be guaranteed to be secure or error-free
as information could be intercepted, corrupted, lost, destroyed,
arrive late or incomplete, or contain viruses. The sender therefore
does not accept liability for any errors or omissions in the contents
of this message which arise as a result of e-mail transmission. If
verification is required please request a hard-copy version. This
message is provided for informational purposes and should not be
construed as a solicitation or offer to buy or sell any securities or
related financial instruments.