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

📄 perlos2.pod

📁 MSYS在windows下模拟了一个类unix的终端
💻 POD
📖 第 1 页 / 共 5 页
字号:
same file, 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 correctly start PM programs from VIO (=text-mode) Perl process;the opposite is not true: when you start a non-PM program from a PMPerl process, it 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>?If not, you need to build a stand-alone DLL for perl. Contact me, Idid it once. Sockets would not work, as a lot of other stuff.=item Did you use L<ExtUtils::Embed>?I had reports it does not work. Somebody would need to fix it.=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>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. In fact F<find.exe> cannot be started at allusing C library API only. Otherwise the following command-lines would beequivalent:  find "pattern" file  find pattern file=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	emxrevA folder is created on your desktop which contains some usefulobjects.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.=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 (likepkunzip), 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:=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">.=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 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.=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(file globbing - if done via shell - may break).=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">), one may get better results bybinary 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 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<pod2info> from C<CPAN>,or, alternately, prebuilt info pages.=head2 F<.PDF> filesfor C<Acrobat> are available on CPAN (for slightly old 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 http://www.shadow.net/~troc/os2perl.html=head2 The short storyAssume that you are a seasoned porter, so are sure that all the necessarytools are already present on your system, and you know how to get the Perlsource distribution.  Untar it, change to the extract directory, and  gnupatch -p0 < os2\diff.configure  sh Configure -des -D prefix=f:/perllib  make  make test  make install  make aout_test  make aout_installThis puts the executables in f:/perllib/bin.  Manually move them to theC<PATH>, manually move the built F<perl*.dll> to C<LIBPATH> (here F<*> isa not-very-meaningful hex checksum), and run  make installcmd INSTALLCMDDIR=d:/ir/on/pathWhat follows is a detailed guide through these steps.=head2 PrerequisitesYou need to have the latest EMX development environment, the fullGNU tool suite (gawk renamed to awk, and GNU F<find.exe>earlier on path than the OS/2 F<find.exe>, same with F<sort.exe>, tocheck use

⌨️ 快捷键说明

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