Re: VMWARE PERL API
- From: krahnj@xxxxxxxxx (John W. Krahn)
- Date: Thu, 02 Aug 2007 08:39:14 -0700
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
.
- Follow-Ups:
- Re: VMWARE PERL API
- From: Vishnu
- Re: VMWARE PERL API
- References:
- Re: VMWARE PERL API
- From: Jeff Pang
- Re: VMWARE PERL API
- Prev by Date: Re: VMWARE PERL API
- Next by Date: Re: missing values from files
- Previous by thread: Re: VMWARE PERL API
- Next by thread: Re: VMWARE PERL API
- Index(es):
Relevant Pages
|