This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Limit index arg to logicals in vmstrnenv().
vmstrnenv looks in the environ array, the DCL symbol table, and/or
the logical names pointed to by LNM$FILE_DEV, depending on the
setting of PERL_ENV_TABLES. Its index parameter, however, only
makes sense with logical names, and when returning one element of
a search list logical. So return 0 indicating a failed lookup when
passed a non-zero index and what we found is not a logical name.
Without this, the natural idiom of iterating over index values to
get the elements of a search list could get us stuck in an endless
loop if the item we are looking for does exist but is not a
logical name.