⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 perlos2.pod

📁 视频监控网络部分的协议ddns,的模块的实现代码,请大家大胆指正.
💻 POD
📖 第 1 页 / 共 5 页
字号:
specified application, thus C<system 'blah'> will not look for a script if there is an executable file F<blah.exe> I<anywhere> on C<PATH>.  Inother words, C<PATH> is essentially searched twice: once by the OS foran executable, then by Perl for scripts.Note also that executable files on OS/2 can have an arbitrary extension, but F<.exe> will be automatically appended if no dot is present in the name.  The workaround is as simple as that:  since F<blah.> and F<blah> denote the same file (at list on FAT and HPFS file systems), to start an executable residing in file F<n:/bin/blah> (no extension) give an argument C<n:/bin/blah.> (dot appended) to system().Perl will start PM programs from VIO (=text-mode) Perl process in aseparate PM session;the opposite is not true: when you start a non-PM program from a PMPerl process, Perl would not run it in a separate session.  If a separatesession is desired, either ensurethat shell will be used, as in C<system 'cmd /c myprog'>, or start it usingoptional arguments to system() documented in C<OS2::Process> module.  Thisis considered to be a feature.=head1 Frequently asked questions=head2 "It does not work"Perl binary distributions come with a F<testperl.cmd> script which triesto detect common problems with misconfigured installations.  There is apretty large chance it will discover which step of the installation youmanaged to goof.  C<;-)>=head2 I cannot run external programs=over 4=item *Did you run your programs with C<-w> switch? See L<Starting OS/2 (and DOS) programs under Perl>.=item *Do you try to run I<internal> shell commands, like C<`copy a b`>(internal for F<cmd.exe>), or C<`glob a*b`> (internal for ksh)? Youneed to specify your shell explicitly, like C<`cmd /c copy a b`>,since Perl cannot deduce which commands are internal to your shell.=back=head2 I cannot embed perl into my program, or use F<perl.dll> from myprogram. =over 4=item Is your program EMX-compiled with C<-Zmt -Zcrtdll>?Well, nowadays Perl DLL should be usable from a differently compiledprogram too...  If you can run Perl code from REXX scripts (seeL<OS2::REXX>), then there are some other aspect of interaction whichare overlooked by the current hackish code to supportdifferently-compiled principal programs.If everything else fails, you need to build a stand-alone DLL forperl. Contact me, I did it once. Sockets would not work, as a lot ofother stuff.=item Did you use L<ExtUtils::Embed>?Some time ago I had reports it does not work.  Nowadays it is checkedin the Perl test suite, so grep F<./t> subdirectory of the build tree(as well as F<*.t> files in the F<./lib> subdirectory) to find how itshould be done "correctly".=back=head2 C<``> and pipe-C<open> do not work under DOS.This may a variant of just L<"I cannot run external programs">, or adeeper problem. Basically: you I<need> RSX (see L<"Prerequisites">)for these commands to work, and you may need a port of F<sh.exe> whichunderstands command arguments. One of such ports is listed inL<"Prerequisites"> under RSX. Do not forget to set variableC<L<"PERL_SH_DIR">> as well.DPMI is required for RSX.=head2 Cannot start C<find.exe "pattern" file>The whole idea of the "standard C API to start applications" is thatthe forms C<foo> and C<"foo"> of program arguments are completelyinterchangable.  F<find> breaks this paradigm;  find "pattern" file  find pattern fileare not equivalent; F<find> cannot be started directly using the aboveAPI.  One needs a way to surround the doublequotes in some otherquoting construction, necessarily having an extra non-Unixish shell inbetween.Use one of  system 'cmd', '/c', 'find "pattern" file';  `cmd /c 'find "pattern" file'`This would start F<find.exe> via F<cmd.exe> via C<sh.exe> viaC<perl.exe>, but this is a price to pay if you want to usenon-conforming program.=head1 INSTALLATION=head2 Automatic binary installationThe most convenient way of installing a binary distribution of perl is via perl installerF<install.exe>. Just follow the instructions, and 99% of theinstallation blues would go away. Note however, that you need to have F<unzip.exe> on your path, andEMX environment I<running>. The latter means that if you justinstalled EMX, and made all the needed changes to F<Config.sys>,you may need to reboot in between. Check EMX runtime by running	emxrevBinary installer also creates a folder on your desktop with some usefulobjects.  If you need to change some aspects of the work of the binaryinstaller, feel free to edit the file F<Perl.pkg>.  This may be usefule.g., if you need to run the installer many times and do not want tomake many interactive changes in the GUI.B<Things not taken care of by automatic binary installation:>=over 15=item C<PERL_BADLANG>may be needed if you change your codepage I<after> perl installation,and the new value is not supported by EMX. See L<"PERL_BADLANG">.=item C<PERL_BADFREE>see L<"PERL_BADFREE">.=item F<Config.pm>This file resides somewhere deep in the location you installed yourperl library, find it out by   perl -MConfig -le "print $INC{'Config.pm'}"While most important values in this file I<are> updated by the binaryinstaller, some of them may need to be hand-edited. I know no suchdata, please keep me informed if you find one.  Moreover, manualchanges to the installed version may need to be accompanied by an editof this file.=backB<NOTE>. Because of a typo the binary installer of 5.00305would install a variable C<PERL_SHPATH> into F<Config.sys>. Pleaseremove this variable and put C<L<PERL_SH_DIR>> instead.=head2 Manual binary installationAs of version 5.00305, OS/2 perl binary distribution comes splitinto 11 components. Unfortunately, to enable configurable binaryinstallation, the file paths in the zip files are not absolute, butrelative to some directory.Note that the extraction with the stored paths is still necessary(default with unzip, specify C<-d> to pkunzip). However, youneed to know where to extract the files. You need also to manuallychange entries in F<Config.sys> to reflect where did you put thefiles. Note that if you have some primitive unzipper (likeC<pkunzip>), you may get a lot of warnings/errors duringunzipping. Upgrade to C<(w)unzip>.Below is the sample of what to do to reproduce the configuration on mymachine.  In F<VIEW.EXE> you can press C<Ctrl-Insert> now, andcut-and-paste from the resulting file - created in the directory youstarted F<VIEW.EXE> from.For each component, we mention environment variables related to eachinstallation directory.  Either choose directories to match yourvalues of the variables, or create/append-to variables to take intoaccount the directories.=over 3=item Perl VIO and PM executables (dynamically linked)  unzip perl_exc.zip *.exe *.ico -d f:/emx.add/bin  unzip perl_exc.zip *.dll -d f:/emx.add/dll(have the directories with C<*.exe> on PATH, and C<*.dll> onLIBPATH);=item Perl_ VIO executable (statically linked)  unzip perl_aou.zip -d f:/emx.add/bin(have the directory on PATH);=item Executables for Perl utilities  unzip perl_utl.zip -d f:/emx.add/bin(have the directory on PATH);=item Main Perl library  unzip perl_mlb.zip -d f:/perllib/libIf this directory is exactly the same as the prefix which was compiledinto F<perl.exe>, you do not need to changeanything. However, for perl to find the library if you use a differentpath, you need toC<set PERLLIB_PREFIX> in F<Config.sys>, see L<"PERLLIB_PREFIX">.=item Additional Perl modules  unzip perl_ste.zip -d f:/perllib/lib/site_perl/5.8.3/Same remark as above applies.  Additionally, if this directory is notone of directories on @INC (and @INC is influenced by C<PERLLIB_PREFIX>), youneed to put thisdirectory and subdirectory F<./os2> in C<PERLLIB> or C<PERL5LIB>variable. Do not use C<PERL5LIB> unless you have it set already. SeeL<perl/"ENVIRONMENT">.B<[Check whether this extraction directory is still applicable withthe new directory structure layout!]>=item Tools to compile Perl modules  unzip perl_blb.zip -d f:/perllib/libSame remark as for F<perl_ste.zip>.=item Manpages for Perl and utilities  unzip perl_man.zip -d f:/perllib/manThis directory should better be on C<MANPATH>. You need to have aworking F<man> to access these files.=item Manpages for Perl modules  unzip perl_mam.zip -d f:/perllib/manThis directory should better be on C<MANPATH>. You need to have aworking man to access these files.=item Source for Perl documentation  unzip perl_pod.zip -d f:/perllib/libThis is used by the C<perldoc> program (see L<perldoc>), and may be used togenerate HTML documentation usable by WWW browsers, anddocumentation in zillions of other formats: C<info>, C<LaTeX>,C<Acrobat>, C<FrameMaker> and so on.  [Use programs such asF<pod2latex> etc.]=item Perl manual in F<.INF> format  unzip perl_inf.zip -d d:/os2/bookThis directory should better be on C<BOOKSHELF>.=item Pdksh  unzip perl_sh.zip -d f:/binThis is used by perl to run external commands which explicitlyrequire shell, like the commands using I<redirection> and I<shellmetacharacters>. It is also used instead of explicit F</bin/sh>.Set C<PERL_SH_DIR> (see L<"PERL_SH_DIR">) if you move F<sh.exe> fromthe above location.B<Note.> It may be possible to use some other sh-compatible shell (untested).=backAfter you installed the components you needed and updated theF<Config.sys> correspondingly, you need to hand-editF<Config.pm>. This file resides somewhere deep in the location youinstalled your perl library, find it out by  perl -MConfig -le "print $INC{'Config.pm'}"You need to correct all the entries which look like file paths (theycurrently start with C<f:/>).=head2 B<Warning>The automatic and manual perl installation leave precompiled pathsinside perl executables. While these paths are overwriteable (seeL<"PERLLIB_PREFIX">, L<"PERL_SH_DIR">), some people may preferbinary editing of paths inside the executables/DLLs.=head1 Accessing documentationDepending on how you built/installed perl you may have (otherwiseidentical) Perl documentation in the following formats:=head2 OS/2 F<.INF> fileMost probably the most convenient form. Under OS/2 view it as  view perl  view perl perlfunc  view perl less  view perl ExtUtils::MakeMaker(currently the last two may hit a wrong location, but this may improvesoon). Under Win* see L<"SYNOPSIS">.If you want to build the docs yourself, and have I<OS/2 toolkit>, run	pod2ipf > perl.ipfin F</perllib/lib/pod> directory, then	ipfc /inf perl.ipf(Expect a lot of errors during the both steps.) Now move it on yourBOOKSHELF path.=head2 Plain textIf you have perl documentation in the source form, perl utilitiesinstalled, and GNU groff installed, you may use 	perldoc perlfunc	perldoc less	perldoc ExtUtils::MakeMakerto access the perl documentation in the text form (note that you may getbetter results using perl manpages).Alternately, try running pod2text on F<.pod> files.=head2 ManpagesIf you have F<man> installed on your system, and you installed perlmanpages, use something like this:	man perlfunc	man 3 less	man ExtUtils.MakeMakerto access documentation for different components of Perl. Start with	man perlNote that dot (F<.>) is used as a package separator for documentationfor packages, and as usual, sometimes you need to give the section - C<3>above - to avoid shadowing by the I<less(1) manpage>.Make sure that the directory B<above> the directory with manpages ison our C<MANPATH>, like this  set MANPATH=c:/man;f:/perllib/manfor Perl manpages in C<f:/perllib/man/man1/> etc.=head2 HTMLIf you have some WWW browser available, installed the Perldocumentation in the source form, and Perl utilities, you can buildHTML docs. Cd to directory with F<.pod> files, and do like this	cd f:/perllib/lib/pod	pod2htmlAfter this you can direct your browser the file F<perl.html> in thisdirectory, and go ahead with reading docs, like this:	explore file:///f:/perllib/lib/pod/perl.htmlAlternatively you may be able to get these docs prebuilt from CPAN.=head2 GNU C<info> filesUsers of Emacs would appreciate it very much, especially withC<CPerl> mode loaded. You need to get latest C<pod2texi> from C<CPAN>,or, alternately, the prebuilt info pages.=head2 F<PDF> filesfor C<Acrobat> are available on CPAN (may be for slightly older version ofperl).=head2 C<LaTeX> docscan be constructed using C<pod2latex>.=head1 BUILDHere we discuss how to build Perl under OS/2. There is an alternative(but maybe older) view on L<http://www.shadow.net/~troc/os2perl.html>.=head2 The short story

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -