At 9:21 PM -0500 2/15/2000, Gregor N. Purdy wrote:

[examples snipped]

Thanks.  One of these days I must take an "advanced curly braces" class.

>I wonder if users and p5p would find it acceptable thusly:
>
>     use Env qw(@DCL$PATH);
>     print join("\n", @DCL_PATH), "\n";
>
>I don't think it would be difficult to arrange for $ to be permitted
>in the name of a var on VMS, and have it mapped to an underscore in
>the variable name. It is possible to have it map to an array named
>with the '$', but using it would be a bit awkward, as in the examples
>above. Are there any other special

>From section 13.3.3 of the URL I posted: "A logical name can contain alphanumeric 
>characters, the underscore (_), the dollar sign ($), and the hyphen (-)."   So 
>hyphens and dollar signs would have to both be translated to underscores (or 
>something).  Then we'd have to deal with the fact that

DCL-PATH
DCL_PATH
DCL$PATH

would all be the same thing internally. Perhaps, for example, the variable @DCL_PATH 
could be expected to map to the logical name DCL_PATH, but if it doesn't exist then we 
could also check DCL$PATH?

> >Ordinary array processing seems to work as expected, although it
>>doesn't die, it just issues a warning and continues:
>
>This was a tyop on my part. I meant warn() when I said die(). Good
>think I don't work for the police, eh?

Don't shoot!  Don't shoot!

>Good. So, it does seem to be working. I do really wish we could do
>read/write, but Dan Sugalski tells me that would involve XS work,
>and I'm not up to that, especially since I don't have VMS access.
>I suppose I'll leave that as an exercise for someone with the
>appropriate tools and motivation.

There's probably a reason this hasn't been done before, although I don't know Dan's 
reasoning specifically.  There are 4 different access modes and about half a dozen 
different logical name tables, plus various attributes on the logical names, such as 
whether they can function as device names or whether their translations can themselves 
be logical names. 

It's one thing to ask for the translation of a logical name that exists, but there's a 
greater level of complexity in creating a new one since you have to decide what 
defaults you want for modes, tables, and attributes, consider how what you do might 
affect other processes, what privileges would be required, and so on.  Yes, this is 
best left to someone who wants to think through all that for VMS.

>BTW, I haven't seen a Unix case that would motivate the enabling
>of:
>
>     use Env qw(%FOO);
>
>especially since there would potentially be the need for two
>delimiters/separators.
>
>But, section 13.6.1 of the reference you gave seems to show usage
>that might apply. However, I'm not convinced that I'm not misunderstanding
>the purpose there.

The example there lists all the logical names in one logical name table, more or less 
like getting a dump of all your environment variables.  The different tables can be 
thought of as separate env arrays, with special rules for looking in the second or 
third array if the item you're looking for isn't found in the first one.  In practice, 
you're generally just interested in (and can only see) the first translation you come 
across following the rules, so I can't think of a good reason to need a hash.  Others 
may differ.
____________________________________________
Craig A. Berry                   
mailto:[EMAIL PROTECTED]

Reply via email to