Here's a little something I've been working on.  The interface probably
needs some work but the code appears to work.  You can use Data::Dumper
to get a quick feel for what it returns.  Grab it from
http://nbpfaus.net/~pfau/perl/vms-logical-0_1.tar-gz.

It looks like someone tried to do this before but from googling it
appears it may not have ever gone anywhere.  I can't find it on CPAN. 
I'd be agreeable to renaming it VMS::LNM or something if necessary to
avoid a namespace collision.

NAME
    VMS::Logical - OpenVMS Logical name interface

SYNOPSIS
      use VMS::Logical qw(translate define deassign);

      $hashref = translate({lognam='sys$sysdevice',
                            case_blind=>1});

      $status = define({lognam=>'TEST_LOGICAL',
                        tabnam=>'LNM$JOB',
                        acmode=>'SUPERVISOR',
                        equiv->[{string=>'equivalence'},
                                {string=>'another'}]});

      $status = deassign({lognam=>'TEST_LOGICAL',
                          tabnam=>'LNM$JOB',
                          acmode=>'SUPERVISOR'});

DESCRIPTION
    VMS::Logical provides access to logical names on OpenVMS systems.

  translate
    Translates a logical name.

      $hash = VMS::Logical::translate('logical_name');
      $hash = VMS::Logical::translate({option=>value});

    The first form can be used for a simple logical name translation using
    default search options. The second form should be used if additional
    options are necessary.

    A hash reference should always be returned. Check the value of "sts" in
    the hash to determine if the logical was translated. This value is the
    status code returned by the SYS$TRNLNM call and should be 1 to indicate
    success.

    The options hash may contain the following values.

    lognam
        The logical name to translate.

    case_blind
        When set to 1, case will be ignored when searching for the logical
        name.

    interlocked
        When set to 1, waits for cluster operations to complete before
        proceeding.

    table
        Specifies the name of the table to be searched for the logical name.

    acmode
        Access mode to use for searching. The value should be one of USER,
        SUPERVISOR, EXECUTIVE or KERNEL. Any abbrevation of these is
        accepted. If specified, only logical names at the specified mode or
        a more privileged mode will be returned.

  define
    Defines a logical name.

      $status = VMS::Logical::define({option=>value});

    The return value is the status code returned by SYS$CRELNM. An odd value
    indicates success.

    The options hash may contain the following values.

    table
        The name of the table to contain the logical name.

    lognam
        The name of the logical to be defined.    

    acmode
        The access mode of the logical name.  

    attr
        Attributes for the logical name. This is a hashref containing the
        following options.

        CONFINE
            Logical will not be copied to subprocesses when spawning.
                         
        NO_ALIAS
            Don't allow duplicate logical names at outer levels.
   
    equiv
        An array of equivalence definitions. Each equivalence is a hashref
        containing the following items.

        attr 
            Attributes for the equivalence. The following attributes are
            supported.
   
            CONCEALED      
                Create a concealed logical.

            TERMINAL
                The equivalence contains no logical names.   
   
        string
            The equivalence string.
   
  deassign
    Deletes a logical name.

      $status = VMS::Logical::deassign({option=>value});
   
    The options hash may contain the following values.    

    table
        Name of the table containing the logical.

    lognam        
        The name of the logical to delete.
   
    acmode       
        The access mode of the logical name.
   
SEE ALSO      
    'HP OpenVMS Programming Concepts Manual' contains a chapter about
    logical names and logical name tables.  

    'HP OpenVMS System Services Reference Manual' provides detailed
    information about the OpenVMS logical name system services.
   
AUTHOR
    Thomas Pfau, < [EMAIL PROTECTED] >                

COPYRIGHT AND LICENSE  
    Copyright (C) 2008 by Thomas Pfau

    This library is free software; you can redistribute it and/or modify it
    under the same terms as Perl itself, either Perl version 5.8.8 or, at
    your option, any later version of Perl 5 you may have available.

Reply via email to