这是一个软件 PERL语言的接口,有也许把它改成VB接口

这是一个软件 PERL语言的接口,有可能把它改成VB接口
这是一个软件 PERL语言的接口,有可能把它改成VB接口么??? 









=head
Package for running Perl programs in a Genesis environment.

This file is included by Genesis.pm.
See Genesis.pm for general documentation.

=cut
require 5.003;
require Exporter;
require 'shellwords.pl';
my $version = '2.0';

use Socket; 
@ISA       = qw(Exporter);


$socketOpen = 0 ;
$DIR_PREFIX = '@%#%@' ; 

END { 
    if ($socketOpen == 0 ) { 
          return ; 
    }
    send(SOCK, "${DIR_PREFIX}CLOSEDOWN \n", 0);
    close (SOCK) || warn "close: $!";
}

sub new { 
    local $class  = shift; # name
    local $remote = shift;
    local $genesis;

    $remote = 'localhost' unless defined $remote;

    # If standard input is not a terminal then we are a pipe to csh, and hence
    # presumably running under Genesis. In this case use stdin and stdout as is.
    # If, on the other hand, stdin is a tty, then we are running remotely, in which case
    # set up the communications, namely the socket, so that we communicate.  

    $genesis->{remote} = $remote;
    $genesis->{port} = 'genesis'; 

    bless $genesis, $class; 

    $genesis->{comms} = 'pipe';
    if (-t STDIN) { 
$genesis->{comms} = 'socket'; 
$genesis->openSocket();
$genesis->{socketOpen} = 1;
$genesis->inheritEnvironment();
    }
    binmode(STDOUT);
    return $genesis; 
}
sub closeDown { 
    local ($genesis) = shift;
    $genesis->sendCommand("CLOSEDOWN","");     
}

sub inheritEnvironment {
    local ($genesis) = shift;
    $genesis->sendCommand("GETENVIRONMENT","");     
    while (1) { 
$reply = $genesis->getReply();
if ($reply eq 'END') { 
    last;
}
($var,$value) = split('=',$reply,2);
$ENV{$var} = $value;
    }
    # And here is a patch for LOCALE. IBM AIX defines LC_MESSAGES and LC__FASTMSG
    # which are not right if you are running remotely
    undef $ENV{LC_MESSAGES};