Re: VMWARE PERL API



Jeff Pang wrote:

From: vishnu <ckmvishnu@xxxxxxxxx>

Im trying to Build an API in perl.

I've included path of my installation like:


sub BEGIN {
push (@INC,
("/usr/lib/vmware-server/perl5/site_perl/5.005/i386-linux",
"."));
}

It's not sub BEGIN but BEGIN block,

BEGIN {
push @INC,"/your/lib/path";
}

perldoc perlmod

[ SNIP ]

BEGIN, CHECK, INIT and END

Four specially named code blocks are executed at the beginning and at the
end of a running Perl program. These are the "BEGIN", "CHECK", "INIT",
and "END" blocks.

These code blocks can be prefixed with "sub" to give the appearance of a
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
subroutine (although this is not considered good style). One should note
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
that these code blocks don’t really exist as named subroutines (despite
their appearance). The thing that gives this away is the fact that you can
have more than one of these code blocks in a program, and they will get
all executed at the appropriate moment. So you can’t execute any of these
code blocks by name.



John
--
Perl isn't a toolbox, but a small machine shop where you
can special-order certain sorts of tools at low cost and
in short order. -- Larry Wall
.



Relevant Pages

  • Re: VMWARE PERL API
    ... The problem was like i had to read the config file in /etc/vmware/ ... It's not sub BEGIN but BEGIN block, ... Four specially named code blocks are executed at the beginning and at ... So you can't execute any of ...
    (perl.beginners)
  • Re: Do my variables scoped to a subroutine get reconstructed every time?
    ... The reason is that some of my code blocks in the qr/// I want to ... affect lexically scoped variables in the sub. ... apply the pattern and return a token ID and lvalue data. ... I'll put it back inside the subroutine. ...
    (comp.lang.perl.misc)
  • Re: OK, lets be a bit negative and look at what APL has not achieved !
    ... extend the idea of "executable code blocks" to "applicable code blocks", which would allow similar operations on monadic and dyadic definitions, along the lines of ... I forget to mention that THETA takes 4 hours to evaluate, and with the current "dereference and execute immediately" rule, THETA gets evaluated twice in your version ... we could then use existing primitives to define just about every control structure known to man -- plus other stuff that other languages can't do, because they're constrained to use only those control structures defined in the language ...
    (comp.lang.apl)
  • Re: OK, lets be a bit negative and look at what APL has not achieved !
    ... extend the idea of "executable code blocks" to "applicable code blocks", which would allow similar operations on monadic and dyadic definitions, along the lines of ... I forget to mention that THETA takes 4 hours to evaluate, and with the current "dereference and execute immediately" rule, THETA gets evaluated twice in your version ...
    (comp.lang.apl)
  • Re: If then Statement with Set Focus to a SubForm
    ... The conditional IF statement IIF() is used to return a value, not execute ... code blocks. ... You need to use a regular IF..THEN format to handle execution ...
    (microsoft.public.access.forms)