Arlekin has asked for the wisdom of the Perl Monks concerning the following question:
sub register_vm { my ($config) = @_; my $connect_params = VMware::VmPerl::ConnectParams::new(); # Establish a persistent connection with server my $server = VMware::VmPerl::Server::new(); if (!$server->connect($connect_params)) { my ($error_number, $error_string) = $server>get_last_error(); die "Could not connect to server: Error $error_number: $error_stri +ng\n"; } if (!$server->register_vm($config)) { my ($error_number, $error_string) = $server>get_last_error(); die "Could not register of VM $config: Error $error_number: $error_ +string\n"; } undef $server; }
bool PerlWrapper::PerlRegisterVm(char* config, char* error) { bool bRet = true; dSP; ENTER; SAVETMPS; PUSHMARK(SP); XPUSHs(sv_2mortal(newSVpv(config, 0))); PUTBACK; perl_call_pv("register_vm", G_DISCARD|G_EVAL); SPAGAIN; if(SvTRUE(ERRSV)) { strcpy(error, SvPV(ERRSV, PL_na)); bRet = false; } PUTBACK; FREETMPS; LEAVE; return bRet; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Perlembed: problem with exception
by shmem (Chancellor) on Oct 25, 2006 at 13:23 UTC | |
|
Re: Perlembed: problem with exception
by syphilis (Archbishop) on Oct 26, 2006 at 02:05 UTC |