This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Add test for grep() and wantarray
[perl5.git] / README.os2
CommitLineData
a56dbb1c
PP
1If you read this file _as_is_, just ignore the funny characters you
2see. It is written in the POD format (see perlpod manpage) which is
3specially designed to be readable as is.
4
5=head1 NAME
6
72ea3524 7perlos2 - Perl under OS/2, DOS, Win0.3*, Win0.95 and WinNT.
a56dbb1c
PP
8
9=head1 SYNOPSIS
10
11One can read this document in the following formats:
12
13 man perlos2
14 view perl perlos2
15 explorer perlos2.html
16 info perlos2
17
18to list some (not all may be available simultaneously), or it may
19be read I<as is>: either as F<README.os2>, or F<pod/perlos2.pod>.
20
72ea3524
IZ
21To read the F<.INF> version of documentation (B<very> recommended)
22outside of OS/2, one needs an IBM's reader (may be available on IBM
df3ef7a9
IZ
23ftp sites (?) (URL anyone?)) or shipped with PC DOS 7.0 and IBM's
24Visual Age C++ 3.5.
25
26A copy of a Win* viewer is contained in the "Just add OS/2 Warp" package
27
28 ftp://ftp.software.ibm.com/ps/products/os2/tools/jaow/jaow.zip
29
30in F<?:\JUST_ADD\view.exe>. This gives one an access to B<EMX>'s
31F<.INF> docs as well (text form is available in F</emx/doc> in
32B<EMX>'s distribution).
72ea3524 33
a56dbb1c
PP
34=cut
35
36Contents
37
df3ef7a9 38 perlos2 - Perl under OS/2, DOS, Win0.3*, Win0.95 and WinNT.
a56dbb1c 39
df3ef7a9
IZ
40 NAME
41 SYNOPSIS
42 DESCRIPTION
a56dbb1c
PP
43 - Target
44 - Other OSes
45 - Prerequisites
46 - Starting Perl programs under OS/2
47 - Starting OS/2 programs under Perl
df3ef7a9 48 Frequently asked questions
72ea3524 49 - I cannot run external programs
df3ef7a9
IZ
50 - I cannot embed perl into my program, or use perl.dll from my program.
51 - `` and pipe-open do not work under DOS.
52 INSTALLATION
a56dbb1c
PP
53 - Automatic binary installation
54 - Manual binary installation
55 - Warning
df3ef7a9 56 Accessing documentation
a56dbb1c
PP
57 - OS/2 .INF file
58 - Plain text
59 - Manpages
60 - HTML
61 - GNU info files
62 - .PDF files
63 - LaTeX docs
df3ef7a9 64 BUILD
a56dbb1c
PP
65 - Prerequisites
66 - Getting perl source
67 - Application of the patches
68 - Hand-editing
69 - Making
70 - Testing
71 - Installing the built perl
72 - a.out-style build
df3ef7a9 73 Build FAQ
a56dbb1c
PP
74 - Some / became \ in pdksh.
75 - 'errno' - unresolved external
76 - Problems with tr
77 - Some problem (forget which ;-)
78 - Library ... not found
df3ef7a9
IZ
79 - Segfault in make
80 Specific (mis)features of OS/2 port
a56dbb1c
PP
81 - setpriority, getpriority
82 - system()
83 - Additional modules:
84 - Prebuilt methods:
85 - Misfeatures
df3ef7a9
IZ
86 - Modifications
87 Perl flavors
a56dbb1c
PP
88 - perl.exe
89 - perl_.exe
90 - perl__.exe
91 - perl___.exe
92 - Why strange names?
93 - Why dynamic linking?
94 - Why chimera build?
df3ef7a9 95 ENVIRONMENT
a56dbb1c
PP
96 - PERLLIB_PREFIX
97 - PERL_BADLANG
98 - PERL_BADFREE
99 - PERL_SH_DIR
100 - TMP or TEMP
df3ef7a9 101 Evolution
a56dbb1c 102 - Priorities
72ea3524 103 - DLL name mangling
a56dbb1c
PP
104 - Threading
105 - Calls to external programs
df3ef7a9
IZ
106 - Memory allocation
107 AUTHOR
108 SEE ALSO
109
a56dbb1c
PP
110=head1 DESCRIPTION
111
112=head2 Target
113
114The target is to make OS/2 the best supported platform for
72ea3524 115using/building/developing Perl and I<Perl applications>, as well as
a56dbb1c
PP
116make Perl the best language to use under OS/2.
117
118The current state is quite close to this target. Known limitations:
119
120=over 5
121
122=item *
123
124Some *nix programs use fork() a lot, but currently fork() is not
125supported after I<use>ing dynamically loaded extensions.
126
127=item *
128
129You need a separate perl executable F<perl__.exe> (see L<perl__.exe>)
130to use PM code in your application (like the forthcoming Perl/Tk).
131
132=item *
133
134There is no simple way to access B<WPS> objects. The only way I know
135is via C<OS2::REXX> extension (see L<OS2::REXX>), and we do not have access to
72ea3524 136convenience methods of B<Object REXX>. (Is it possible at all? I know
a56dbb1c
PP
137of no B<Object-REXX> API.)
138
139=back
140
141Please keep this list up-to-date by informing me about other items.
142
143=head2 Other OSes
144
145Since OS/2 port of perl uses a remarkable B<EMX> environment, it can
146run (and build extensions, and - possibly - be build itself) under any
147environment which can run EMX. The current list is DOS,
72ea3524 148DOS-inside-OS/2, Win0.3*, Win0.95 and WinNT. Out of many perl flavors,
a56dbb1c
PP
149only one works, see L<"perl_.exe">.
150
151Note that not all features of Perl are available under these
152environments. This depends on the features the I<extender> - most
153probably C<RSX> - decided to implement.
154
155Cf. L<Prerequisites>.
156
157=head2 Prerequisites
158
159=over 6
160
161=item B<EMX>
162
55497cff
PP
163B<EMX> runtime is required (may be substituted by B<RSX>). Note that
164it is possible to make F<perl_.exe> to run under DOS without any
72ea3524 165external support by binding F<emx.exe>/F<rsx.exe> to it, see L<emxbind>. Note
55497cff
PP
166that under DOS for best results one should use B<RSX> runtime, which
167has much more functions working (like C<fork>, C<popen> and so on). In
72ea3524
IZ
168fact B<RSX> is required if there is no C<VCPI> present. Note the
169B<RSX> requires C<DPMI>.
a56dbb1c
PP
170
171Only the latest runtime is supported, currently C<0.9c>.
172
173One can get different parts of B<EMX> from, say
174
175 ftp://ftp.cdrom.com/pub/os2/emx0.9c/
176 ftp://hobbes.nmsu.edu/os2/unix/gnu/
177
178The runtime component should have the name F<emxrt.zip>.
179
72ea3524
IZ
180B<NOTE>. It is enough to have F<emx.exe>/F<rsx.exe> on your path. One
181does not need to specify them explicitly (though this
182
183 emx perl_.exe -de 0
184
185will work as well.)
186
a56dbb1c
PP
187=item B<RSX>
188
72ea3524
IZ
189To run Perl on C<DPMI> platforms one needs B<RSX> runtime. This is
190needed under DOS-inside-OS/2, Win0.3*, Win0.95 and WinNT (see
191L<"Other OSes">). B<RSX> would not work with C<VCPI>
192only, as B<EMX> would, it requires C<DMPI>.
55497cff
PP
193
194Having B<RSX> and the latest F<sh.exe> one gets a fully functional
195B<*nix>-ish environment under DOS, say, C<fork>, C<``> and
196pipe-C<open> work. In fact, MakeMaker works (for static build), so one
197can have Perl development environment under DOS.
a56dbb1c
PP
198
199One can get B<RSX> from, say
200
201 ftp://ftp.cdrom.com/pub/os2/emx0.9c/contrib
202 ftp://ftp.uni-bielefeld.de/pub/systems/msdos/misc
203
204Contact the author on C<rainer@mathematik.uni-bielefeld.de>.
205
55497cff
PP
206The latest F<sh.exe> with DOS hooks is available at
207
208 ftp://ftp.math.ohio-state.edu/pub/users/ilya/os2/sh_dos.exe
209
a56dbb1c
PP
210=item B<HPFS>
211
212Perl does not care about file systems, but to install the whole perl
213library intact one needs a file system which supports long file names.
214
215Note that if you do not plan to build the perl itself, it may be
216possible to fool B<EMX> to truncate file names. This is not supported,
217read B<EMX> docs to see how to do it.
218
219=back
220
221=head2 Starting Perl programs under OS/2
222
223Start your Perl program F<foo.pl> with arguments C<arg1 arg2 arg3> the
224same way as on any other platform, by
225
226 perl foo.pl arg1 arg2 arg3
227
228If you want to specify perl options C<-my_opts> to the perl itself (as
229opposed to to your program), use
230
231 perl -my_opts foo.pl arg1 arg2 arg3
232
233Alternately, if you use OS/2-ish shell, like C<CMD> or C<4os2>, put
234the following at the start of your perl script:
235
236 extproc perl -x -S
237 #!/usr/bin/perl -my_opts
238
239rename your program to F<foo.cmd>, and start it by typing
240
241 foo arg1 arg2 arg3
242
243(Note that having *nixish full path to perl F</usr/bin/perl> is not
244necessary, F<perl> would be enough, but having full path would make it
245easier to use your script under *nix.)
246
247Note that because of stupid OS/2 limitations the full path of the perl
248script is not available when you use C<extproc>, thus you are forced to
249use C<-S> perl switch, and your script should be on path. As a plus
250side, if you know a full path to your script, you may still start it
251with
252
253 perl -x ../../blah/foo.cmd arg1 arg2 arg3
254
255(note that the argument C<-my_opts> is taken care of by the C<#!> line
256in your script).
257
258To understand what the above I<magic> does, read perl docs about C<-S>
259and C<-x> switches - see L<perlrun>, and cmdref about C<extproc>:
260
261 view perl perlrun
262 man perlrun
263 view cmdref extproc
264 help extproc
265
266or whatever method you prefer.
267
72ea3524 268There are also endless possibilities to use I<executable extensions> of
a56dbb1c
PP
269B<4OS2>, I<associations> of B<WPS> and so on... However, if you use
270*nixish shell (like F<sh.exe> supplied in the binary distribution),
72ea3524 271you need to follow the syntax specified in L<perlrun/"Switches">.
a56dbb1c
PP
272
273=head2 Starting OS/2 programs under Perl
274
275This is what system() (see L<perlfunc/system>), C<``> (see
276L<perlop/"I/O Operators">), and I<open pipe> (see L<perlfunc/open>)
277are for. (Avoid exec() (see L<perlfunc/exec>) unless you know what you
278do).
279
280Note however that to use some of these operators you need to have a
281C<sh>-syntax shell installed (see L<"Pdksh">,
282L<"Frequently asked questions">), and perl should be able to find it
283(see L<"PERL_SH_DIR">).
284
285The only cases when the shell is not used is the multi-argument
286system() (see L<perlfunc/system>)/exec() (see L<perlfunc/exec>), and
287one-argument version thereof without redirection and shell
288meta-characters.
289
290=head1 Frequently asked questions
291
72ea3524 292=head2 I cannot run external programs
a56dbb1c 293
55497cff
PP
294=over 4
295
296=item
297
a56dbb1c
PP
298Did you run your programs with C<-w> switch? See
299L<Starting OS/2 programs under Perl>.
300
55497cff
PP
301=item
302
303Do you try to run I<internal> shell commands, like C<`copy a b`>
304(internal for F<cmd.exe>), or C<`glob a*b`> (internal for ksh)? You
72ea3524 305need to specify your shell explicitly, like C<`cmd /c copy a b`>,
55497cff
PP
306since Perl cannot deduce which commands are internal to your shell.
307
308=back
309
a56dbb1c
PP
310=head2 I cannot embed perl into my program, or use F<perl.dll> from my
311program.
312
313=over 4
314
315=item Is your program B<EMX>-compiled with C<-Zmt -Zcrtdll>?
316
317If not, you need to build a stand-alone DLL for perl. Contact me, I
318did it once. Sockets would not work, as a lot of other stuff.
319
320=item Did you use C<ExtUtils::Embed>?
321
322I had reports it does not work. Somebody would need to fix it.
323
324=back
325
55497cff
PP
326=head2 C<``> and pipe-C<open> do not work under DOS.
327
72ea3524 328This may a variant of just L<"I cannot run external programs">, or a
55497cff 329deeper problem. Basically: you I<need> B<RSX> (see L<"Prerequisites">)
72ea3524 330for these commands to work, and you may need a port of F<sh.exe> which
55497cff
PP
331understands command arguments. One of such ports is listed in
332L<"Prerequisites"> under B<RSX>.
333
72ea3524 334C<DPMI> is required for B<RSX>.
55497cff 335
a56dbb1c
PP
336=head1 INSTALLATION
337
338=head2 Automatic binary installation
339
72ea3524 340The most convenient way of installing perl is via perl installer
a56dbb1c
PP
341F<install.exe>. Just follow the instructions, and 99% of the
342installation blues would go away.
343
344Note however, that you need to have F<unzip.exe> on your path, and
345B<EMX> environment I<running>. The latter means that if you just
346installed B<EMX>, and made all the needed changes to F<Config.sys>,
347you may need to reboot in between. Check B<EMX> runtime by running
348
349 emxrev
350
351A folder is created on your desktop which contains some useful
352objects.
353
354B<Things not taken care of by automatic binary installation:>
355
356=over 15
357
358=item C<PERL_BADLANG>
359
360may be needed if you change your codepage I<after> perl installation,
361and the new value is not supported by B<EMX>. See L<"PERL_BADLANG">.
362
363=item C<PERL_BADFREE>
364
365see L<"PERL_BADFREE">.
366
367=item F<Config.pm>
368
369This file resides somewhere deep in the location you installed your
370perl library, find it out by
371
372 perl -MConfig -le "print $INC{'Config.pm'}"
373
374While most important values in this file I<are> updated by the binary
375installer, some of them may need to be hand-edited. I know no such
376data, please keep me informed if you find one.
377
378=back
379
380=head2 Manual binary installation
381
72ea3524 382As of version 5.00305, OS/2 perl binary distribution comes split
a56dbb1c
PP
383into 11 components. Unfortunately, to enable configurable binary
384installation, the file paths in the C<zip> files are not absolute, but
385relative to some directory.
386
387Note that the extraction with the stored paths is still necessary
388(default with C<unzip>, specify C<-d> to C<pkunzip>). However, you
389need to know where to extract the files. You need also to manually
390change entries in F<Config.sys> to reflect where did you put the
72ea3524
IZ
391files. Note that if you have some primitive unzipper (like
392C<pkunzip>), you may get a lot of warnings/errors during
393unzipping. Upgrade to C<(w)unzip>.
a56dbb1c
PP
394
395Below is the sample of what to do to reproduce the configuration on my
396machine:
397
398=over 3
399
400=item Perl VIO and PM executables (dynamically linked)
401
402 unzip perl_exc.zip *.exe *.ico -d f:/emx.add/bin
403 unzip perl_exc.zip *.dll -d f:/emx.add/dll
404
405(have the directories with C<*.exe> on C<PATH>, and C<*.dll> on
406C<LIBPATH>);
407
408=item Perl_ VIO executable (statically linked)
409
410 unzip perl_aou.zip -d f:/emx.add/bin
411
412(have the directory on C<PATH>);
413
414=item Executables for Perl utilities
415
416 unzip perl_utl.zip -d f:/emx.add/bin
417
418(have the directory on C<PATH>);
419
420=item Main Perl library
421
422 unzip perl_mlb.zip -d f:/perllib/lib
423
424If this directory is preserved, you do not need to change
425anything. However, for perl to find it if it is changed, you need to
426C<set PERLLIB_PREFIX> in F<Config.sys>, see L<"PERLLIB_PREFIX">.
427
428=item Additional Perl modules
429
430 unzip perl_ste.zip -d f:/perllib/lib/site_perl
431
432If you do not change this directory, do nothing. Otherwise put this
433directory and subdirectory F<./os2> in C<PERLLIB> or C<PERL5LIB>
434variable. Do not use C<PERL5LIB> unless you have it set already. See
435L<perl/"ENVIRONMENT">.
436
437=item Tools to compile Perl modules
438
439 unzip perl_blb.zip -d f:/perllib/lib
440
441If this directory is preserved, you do not need to change
442anything. However, for perl to find it if it is changed, you need to
443C<set PERLLIB_PREFIX> in F<Config.sys>, see L<"PERLLIB_PREFIX">.
444
445=item Manpages for Perl and utilities
446
447 unzip perl_man.zip -d f:/perllib/man
448
449This directory should better be on C<MANPATH>. You need to have a
450working C<man> to access these files.
451
452=item Manpages for Perl modules
453
454 unzip perl_mam.zip -d f:/perllib/man
455
456This directory should better be on C<MANPATH>. You need to have a
457working C<man> to access these files.
458
459=item Source for Perl documentation
460
461 unzip perl_pod.zip -d f:/perllib/lib
462
463This is used by by C<perldoc> program (see L<perldoc>), and may be used to
464generate B<HTML> documentation usable by WWW browsers, and
465documentation in zillions of other formats: C<info>, C<LaTeX>,
466C<Acrobat>, C<FrameMaker> and so on.
467
468=item Perl manual in .INF format
469
470 unzip perl_inf.zip -d d:/os2/book
471
472This directory should better be on C<BOOKSHELF>.
473
474=item Pdksh
475
476 unzip perl_sh.zip -d f:/bin
477
72ea3524 478This is used by perl to run external commands which explicitly
a56dbb1c
PP
479require shell, like the commands using I<redirection> and I<shell
480metacharacters>. It is also used instead of explicit F</bin/sh>.
481
482Set C<PERL_SH_DIR> (see L<"PERL_SH_DIR">) if you move F<sh.exe> from
483the above location.
484
485B<Note.> It may be possible to use some other C<sh>-compatible shell
486(I<not tested>).
487
488=back
489
490After you installed the components you needed and updated the
491F<Config.sys> correspondingly, you need to hand-edit
492F<Config.pm>. This file resides somewhere deep in the location you
493installed your perl library, find it out by
494
495 perl -MConfig -le "print $INC{'Config.pm'}"
496
497You need to correct all the entries which look like file paths (they
498currently start with C<f:/>).
499
500=head2 B<Warning>
501
502The automatic and manual perl installation leave precompiled paths
503inside perl executables. While these paths are overwriteable (see
504L<"PERLLIB_PREFIX">, L<"PERL_SH_DIR">), one may get better results by
505binary editing of paths inside the executables/DLLs.
506
507=head1 Accessing documentation
508
509Depending on how you built/installed perl you may have (otherwise
510identical) Perl documentation in the following formats:
511
512=head2 OS/2 F<.INF> file
513
72ea3524 514Most probably the most convenient form. View it as
a56dbb1c
PP
515
516 view perl
517 view perl perlfunc
518 view perl less
519 view perl ExtUtils::MakeMaker
520
521(currently the last two may hit a wrong location, but this may improve
522soon).
523
524If you want to build the docs yourself, and have I<OS/2 toolkit>, run
525
526 pod2ipf > perl.ipf
527
528in F</perllib/lib/pod> directory, then
529
530 ipfc /inf perl.ipf
531
532(Expect a lot of errors during the both steps.) Now move it on your
533BOOKSHELF path.
534
535=head2 Plain text
536
537If you have perl documentation in the source form, perl utilities
538installed, and B<GNU> C<groff> installed, you may use
539
540 perldoc perlfunc
541 perldoc less
542 perldoc ExtUtils::MakeMaker
543
72ea3524 544to access the perl documentation in the text form (note that you may get
a56dbb1c
PP
545better results using perl manpages).
546
547Alternately, try running pod2text on F<.pod> files.
548
549=head2 Manpages
550
551If you have C<man> installed on your system, and you installed perl
552manpages, use something like this:
5243f9ae 553
5243f9ae
PP
554 man perlfunc
555 man 3 less
556 man ExtUtils.MakeMaker
5243f9ae 557
a56dbb1c
PP
558to access documentation for different components of Perl. Start with
559
560 man perl
561
562Note that dot (F<.>) is used as a package separator for documentation
563for packages, and as usual, sometimes you need to give the section - C<3>
564above - to avoid shadowing by the I<less(1) manpage>.
565
566Make sure that the directory B<above> the directory with manpages is
567on our C<MANPATH>, like this
568
569 set MANPATH=c:/man;f:/perllib/man
570
571=head2 B<HTML>
572
573If you have some WWW browser available, installed the Perl
574documentation in the source form, and Perl utilities, you can build
575B<HTML> docs. Cd to directory with F<.pod> files, and do like this
576
577 cd f:/perllib/lib/pod
5243f9ae 578 pod2html
5243f9ae 579
a56dbb1c
PP
580After this you can direct your browser the file F<perl.html> in this
581directory, and go ahead with reading docs, like this:
5243f9ae 582
a56dbb1c 583 explore file:///f:/perllib/lib/pod/perl.html
5243f9ae 584
72ea3524 585Alternatively you may be able to get these docs prebuilt from C<CPAN>.
5243f9ae 586
a56dbb1c 587=head2 B<GNU> C<info> files
bb14ff96 588
a56dbb1c
PP
589Users of C<Emacs> would appreciate it very much, especially with
590C<CPerl> mode loaded. You need to get latest C<pod2info> from C<CPAN>,
591or, alternately, prebuilt info pages.
615d1a09 592
a56dbb1c
PP
593=head2 F<.PDF> files
594
595for C<Acrobat> are available on CPAN (for slightly old version of
596perl).
597
598=head2 C<LaTeX> docs
599
600can be constructed using C<pod2latex>.
601
602=head1 BUILD
603
604Here we discuss how to build Perl under OS/2. There is an alternative
605(but maybe older) view on L<http://www.shadow.net/~troc/os2perl.html>.
606
607=head2 Prerequisites
608
609You need to have the latest B<EMX> development environment, the full
610B<GNU> tool suite (C<gawk> renamed to C<awk>, and B<GNU> F<find.exe>
611earlier on path than the OS/2 F<find.exe>, same with F<sort.exe>, to
612check use
613
614 find --version
615 sort --version
616
617). You need the latest version of F<pdksh> installed as F<sh.exe>.
618
619Possible locations to get this from are
620
621 ftp://hobbes.nmsu.edu/os2/unix/gnu/
622 ftp://ftp.cdrom.com/pub/os2/unix/
623 ftp://ftp.cdrom.com/pub/os2/dev32/
624 ftp://ftp.cdrom.com/pub/os2/emx0.9c/
625
626
627Make sure that no copies or perl are currently running. Later steps
628of the build may fail since an older version of perl.dll loaded into
629memory may be found.
630
631Also make sure that you have F</tmp> directory on the current drive,
632and F<.> directory in your C<LIBPATH>. One may try to correct the
633latter condition by
634
635 set BEGINLIBPATH .
636
637if you use something like F<CMD.EXE> or latest versions of F<4os2.exe>.
638
639Make sure your C<gcc> is good for C<-Zomf> linking: run C<omflibs>
640script in F</emx/lib> directory.
641
642Check that you have C<link386> installed. It comes standard with OS/2,
643but may be not installed due to customization. If typing
644
645 link386
646
647shows you do not have it, do I<Selective install>, and choose C<Link
72ea3524 648object modules> in I<Optional system utilities/More>. If you get into
a56dbb1c
PP
649C<link386>, press C<Ctrl-C>.
650
651=head2 Getting perl source
652
72ea3524 653You need to fetch the latest perl source (including developers
a56dbb1c
PP
654releases). With some probability it is located in
655
656 http://www.perl.com/CPAN/src/5.0
657 http://www.perl.com/CPAN/src/5.0/unsupported
658
659If not, you may need to dig in the indices to find it in the directory
660of the current maintainer.
661
72ea3524 662Quick cycle of developers release may break the OS/2 build time to
a56dbb1c
PP
663time, looking into
664
665 http://www.perl.com/CPAN/ports/os2/ilyaz/
666
667may indicate the latest release which was publicly released by the
668maintainer. Note that the release may include some additional patches
669to apply to the current source of perl.
670
671Extract it like this
672
673 tar vzxf perl5.00409.tar.gz
674
675You may see a message about errors while extracting F<Configure>. This is
676because there is a conflict with a similarly-named file F<configure>.
677
678Rename F<configure> to F<configure.gnu>. Extract F<Configure> like this
679
680 tar --case-sensitive -vzxf perl5.00409.tar.gz perl5.00409/Configure
681
682Change to the directory of extraction.
683
684=head2 Application of the patches
685
686You need to apply the patches in F<./os2/diff.*> and
687F<./os2/POSIX.mkfifo> like this:
688
689 gnupatch -p0 < os2\POSIX.mkfifo
df3ef7a9 690 gnupatch -p0 < os2\diff.configure
a56dbb1c
PP
691
692You may also need to apply the patches supplied with the binary
693distribution of perl.
694
695Note also that the F<db.lib> and F<db.a> from the B<EMX> distribution
696are not suitable for multi-threaded compile (note that currently perl
697is not multithreaded, but is compiled as multithreaded for
698compatibility with B<XFree86>-OS/2). Get a corrected one from
699
700 ftp://ftp.math.ohio-state.edu/pub/users/ilya/os2/db_mt.zip
701
702=head2 Hand-editing
703
704You may look into the file F<./hints/os2.sh> and correct anything
705wrong you find there. I do not expect it is needed anywhere.
615d1a09 706
a56dbb1c 707=head2 Making
615d1a09 708
a56dbb1c 709 sh Configure -des -D prefix=f:/perllib
615d1a09 710
a56dbb1c
PP
711Prefix means where to install the resulting perl library. Giving
712correct prefix you may avoid the need to specify C<PERLLIB_PREFIX>,
713see L<"PERLLIB_PREFIX">.
5243f9ae 714
a56dbb1c
PP
715I<Ignore the message about missing C<ln>, and about C<-c> option to
716C<tr>>. In fact if you can trace where the latter spurious warning
717comes from, please inform me.
615d1a09 718
a56dbb1c 719Now
5243f9ae 720
a56dbb1c 721 make
5243f9ae 722
a56dbb1c
PP
723At some moment the built may die, reporting a I<version mismatch> or
724I<unable to run F<perl>>. This means that most of the build has been
725finished, and it is the time to move the constructed F<perl.dll> to
726some I<absolute> location in C<LIBPATH>. After this done the build
727should finish without a lot of fuss. I<One can avoid it if one has the
728correct prebuilt version of F<perl.dll> on C<LIBPATH>.>
615d1a09 729
a56dbb1c
PP
730Warnings which are safe to ignore: I<mkfifo() redefined> inside
731F<POSIX.c>.
615d1a09 732
a56dbb1c
PP
733=head2 Testing
734
735Now run
736
737 make test
738
72ea3524 739Some tests (4..6) should fail. Some perl invocations should end in a
a56dbb1c
PP
740segfault (system error C<SYS3175>). To get finer error reports,
741
742 cd t
743 perl -I ../lib harness
744
745The report you get may look like
746
747 Failed Test Status Wstat Total Fail Failed List of failed
748 ---------------------------------------------------------------
749 io/fs.t 26 11 42.31% 2-5, 7-11, 18, 25
750 lib/io_pipe.t 3 768 6 ?? % ??
751 lib/io_sock.t 3 768 5 ?? % ??
752 op/stat.t 56 5 8.93% 3-4, 20, 35, 39
72ea3524 753 Failed 4/140 test scripts, 97.14% okay. 27/2937 subtests failed, 99.08% okay.
a56dbb1c
PP
754
755Note that using `make test' target two more tests may fail: C<op/exec:1>
756because of (mis)feature of C<pdksh>, and C<lib/posix:15>, which checks
55497cff
PP
757that the buffers are not flushed on C<_exit> (this is a bug in the test
758which assumes that tty output is buffered).
a56dbb1c 759
72ea3524
IZ
760I submitted a patch to B<EMX> which makes it possible to fork() with EMX
761dynamic libraries loaded, which makes F<lib/io*> tests pass. This means
762that soon the number of failing tests may decrease yet more.
763
df3ef7a9
IZ
764However, the test F<lib/io_udp.t> is disabled, since it never terminates, I
765do not know why. Comments/fixes welcome.
72ea3524 766
a56dbb1c
PP
767The reasons for failed tests are:
768
769=over 8
770
771=item F<io/fs.t>
772
773Checks I<file system> operations. Tests:
774
775=over 10
776
777=item 2-5, 7-11
778
779Check C<link()> and C<inode count> - nonesuch under OS/2.
780
781=item 18
782
783Checks C<atime> and C<mtime> of C<stat()> - I could not understand this test.
784
785=item 25
786
787Checks C<truncate()> on a filehandle just opened for write - I do not
788know why this should or should not work.
789
790=back
791
792=item F<lib/io_pipe.t>
793
794Checks C<IO::Pipe> module. Some feature of B<EMX> - test fork()s with
795dynamic extension loaded - unsupported now.
796
797=item F<lib/io_sock.t>
798
799Checks C<IO::Socket> module. Some feature of B<EMX> - test fork()s
800with dynamic extension loaded - unsupported now.
801
802=item F<op/stat.t>
803
804Checks C<stat()>. Tests:
805
806=over 4
807
808=item 3
809
810Checks C<inode count> - nonesuch under OS/2.
811
812=item 4
813
814Checks C<mtime> and C<ctime> of C<stat()> - I could not understand this test.
815
816=item 20
817
818Checks C<-x> - determined by the file extension only under OS/2.
819
820=item 35
821
822Needs F</usr/bin>.
823
824=item 39
825
826Checks C<-t> of F</dev/null>. Should not fail!
827
828=back
829
830=back
831
832In addition to errors, you should get a lot of warnings.
833
834=over 4
835
836=item A lot of `bad free'
837
838in databases related to Berkeley DB. This is a confirmed bug of
839DB. You may disable this warnings, see L<"PERL_BADFREE">.
840
841=item Process terminated by SIGTERM/SIGINT
842
843This is a standard message issued by OS/2 applications. *nix
844applications die in silence. It is considered a feature. One can
845easily disable this by appropriate sighandlers.
846
847However the test engine bleeds these message to screen in unexpected
848moments. Two messages of this kind I<should> be present during
849testing.
850
851=item F<*/sh.exe>: ln: not found
852
853=item C<ls>: /dev: No such file or directory
854
855The last two should be self-explanatory. The test suite discovers that
856the system it runs on is not I<that much> *nixish.
857
858=back
615d1a09
PP
859
860A lot of `bad free'... in databases, bug in DB confirmed on other
5243f9ae 861platforms. You may disable it by setting PERL_BADFREE environment variable
a56dbb1c 862to 1.
615d1a09 863
a56dbb1c 864=head2 Installing the built perl
615d1a09 865
a56dbb1c 866Run
615d1a09 867
a56dbb1c 868 make install
615d1a09 869
a56dbb1c
PP
870It would put the generated files into needed locations. Manually put
871F<perl.exe>, F<perl__.exe> and F<perl___.exe> to a location on your
872C<PATH>, F<perl.dll> to a location on your C<LIBPATH>.
615d1a09 873
a56dbb1c 874Run
615d1a09 875
a56dbb1c 876 make cmdscripts INSTALLCMDDIR=d:/ir/on/path
615d1a09 877
a56dbb1c
PP
878to convert perl utilities to F<.cmd> files and put them on
879C<PATH>. You need to put F<.EXE>-utilities on path manually. They are
880installed in C<$prefix/bin>, here C<$prefix> is what you gave to
881F<Configure>, see L<Making>.
882
883=head2 C<a.out>-style build
884
885Proceed as above, but make F<perl_.exe> (see L<"perl_.exe">) by
886
887 make perl_
888
889test and install by
890
891 make aout_test
892 make aout_install
893
894Manually put F<perl_.exe> to a location on your C<PATH>.
895
896Since C<perl_> has the extensions prebuilt, it does not suffer from
72ea3524 897the I<dynamic extensions + fork()> syndrome, thus the failing tests
a56dbb1c
PP
898look like
899
900 Failed Test Status Wstat Total Fail Failed List of failed
901 ---------------------------------------------------------------
902 io/fs.t 26 11 42.31% 2-5, 7-11, 18, 25
903 op/stat.t 56 5 8.93% 3-4, 20, 35, 39
904 Failed 2/118 test scripts, 98.31% okay. 16/2445 subtests failed, 99.35% okay.
905
906B<Note.> The build process for C<perl_> I<does not know> about all the
907dependencies, so you should make sure that anything is up-to-date,
908say, by doing
909
910 make perl.dll
911
912first.
913
914=head1 Build FAQ
915
916=head2 Some C</> became C<\> in pdksh.
917
918You have a very old pdksh. See L<Prerequisites>.
919
920=head2 C<'errno'> - unresolved external
921
922You do not have MT-safe F<db.lib>. See L<Prerequisites>.
923
924=head2 Problems with C<tr>
925
926reported with very old version of C<tr>.
927
928=head2 Some problem (forget which ;-)
929
930You have an older version of F<perl.dll> on your C<LIBPATH>, which
931broke the build of extensions.
932
933=head2 Library ... not found
934
935You did not run C<omflibs>. See L<Prerequisites>.
936
937=head2 Segfault in make
938
939You use an old version of C<GNU> make. See L<Prerequisites>.
940
941=head1 Specific (mis)features of OS/2 port
942
943=head2 C<setpriority>, C<getpriority>
944
945Note that these functions are compatible with *nix, not with the older
946ports of '94 - 95. The priorities are absolute, go from 32 to -95,
72ea3524 947lower is quicker. 0 is the default priority.
a56dbb1c
PP
948
949=head2 C<system()>
950
951Multi-argument form of C<system()> allows an additional numeric
952argument. The meaning of this argument is described in
953L<OS2::Process>.
954
955=head2 Additional modules:
615d1a09 956
a56dbb1c
PP
957L<OS2::Process>, L<OS2::REXX>, L<OS2::PrfDB>, L<OS2::ExtAttr>. This
958modules provide access to additional numeric argument for C<system>,
959to DLLs having functions with REXX signature and to REXX runtime, to
960OS/2 databases in the F<.INI> format, and to Extended Attributes.
615d1a09 961
72ea3524 962Two additional extensions by Andreas Kaiser, C<OS2::UPM>, and
a56dbb1c 963C<OS2::FTP>, are included into my ftp directory, mirrored on CPAN.
615d1a09 964
a56dbb1c 965=head2 Prebuilt methods:
615d1a09 966
a56dbb1c 967=over 4
615d1a09 968
a56dbb1c 969=item C<File::Copy::syscopy>
615d1a09 970
a56dbb1c 971used by C<File::Copy::copy>, see L<File::Copy/copy>.
615d1a09 972
a56dbb1c 973=item C<DynaLoader::mod2fname>
615d1a09 974
72ea3524 975used by C<DynaLoader> for DLL name mangling.
615d1a09 976
a56dbb1c 977=item C<Cwd::current_drive()>
615d1a09 978
a56dbb1c 979Self explanatory.
615d1a09 980
a56dbb1c 981=item C<Cwd::sys_chdir(name)>
615d1a09 982
a56dbb1c 983leaves drive as it is.
615d1a09 984
a56dbb1c 985=item C<Cwd::change_drive(name)>
615d1a09 986
615d1a09 987
a56dbb1c 988=item C<Cwd::sys_is_absolute(name)>
615d1a09 989
a56dbb1c 990means has drive letter and is_rooted.
615d1a09 991
a56dbb1c 992=item C<Cwd::sys_is_rooted(name)>
615d1a09 993
a56dbb1c 994means has leading C<[/\\]> (maybe after a drive-letter:).
615d1a09 995
a56dbb1c 996=item C<Cwd::sys_is_relative(name)>
615d1a09 997
a56dbb1c 998means changes with current dir.
615d1a09 999
a56dbb1c 1000=item C<Cwd::sys_cwd(name)>
615d1a09 1001
a56dbb1c 1002Interface to cwd from B<EMX>. Used by C<Cwd::cwd>.
615d1a09 1003
a56dbb1c 1004=item C<Cwd::sys_abspath(name, dir)>
615d1a09 1005
a56dbb1c
PP
1006Really really odious function to implement. Returns absolute name of
1007file which would have C<name> if CWD were C<dir>. C<Dir> defaults to the
1008current dir.
615d1a09 1009
a56dbb1c 1010=item C<Cwd::extLibpath([type])
615d1a09 1011
a56dbb1c
PP
1012Get current value of extended library search path. If C<type> is
1013present and I<true>, works with END_LIBPATH, otherwise with
1014C<BEGIN_LIBPATH>.
615d1a09 1015
a56dbb1c 1016=item C<Cwd::extLibpath_set( path [, type ] )>
615d1a09 1017
a56dbb1c
PP
1018Set current value of extended library search path. If C<type> is
1019present and I<true>, works with END_LIBPATH, otherwise with
1020C<BEGIN_LIBPATH>.
615d1a09 1021
a56dbb1c 1022=back
615d1a09 1023
a56dbb1c
PP
1024(Note that some of these may be moved to different libraries -
1025eventually).
615d1a09 1026
615d1a09 1027
a56dbb1c 1028=head2 Misfeatures
615d1a09 1029
a56dbb1c 1030=over 4
615d1a09 1031
a56dbb1c 1032=item
615d1a09 1033
55497cff
PP
1034Since <flock> is present in B<EMX>, but is not functional, the same is
1035true for perl. Here is the list of things which may be "broken" on
1036EMX (from EMX docs):
1037
1038 - The functions recvmsg(), sendmsg(), and socketpair() are not
1039 implemented.
1040 - sock_init() is not required and not implemented.
1041 - flock() is not yet implemented (dummy function).
1042 - kill:
1043 Special treatment of PID=0, PID=1 and PID=-1 is not implemented.
1044 - waitpid:
1045 WUNTRACED
1046 Not implemented.
1047 waitpid() is not implemented for negative values of PID.
1048
1049Note that C<kill -9> does not work with the current version of EMX.
615d1a09 1050
a56dbb1c 1051=item
615d1a09 1052
72ea3524 1053Since F<sh.exe> is used for globing (see L<perlfunc/glob>), the bugs
a56dbb1c 1054of F<sh.exe> plague perl as well.
615d1a09 1055
a56dbb1c
PP
1056In particular, uppercase letters do not work in C<[...]>-patterns with
1057the current C<pdksh>.
615d1a09 1058
a56dbb1c 1059=back
615d1a09 1060
55497cff
PP
1061=head2 Modifications
1062
1063Perl modifies some standard C library calls in the following ways:
1064
1065=over 9
1066
1067=item C<popen>
1068
72ea3524 1069C<my_popen> uses F<sh.exe> if shell is required, cf. L<"PERL_SH_DIR">.
55497cff
PP
1070
1071=item C<tmpnam>
1072
1073is created using C<TMP> or C<TEMP> environment variable, via
1074C<tempnam>.
1075
1076=item C<tmpfile>
1077
72ea3524 1078If the current directory is not writable, file is created using modified
55497cff
PP
1079C<tmpnam>, so there may be a race condition.
1080
1081=item C<ctermid>
1082
1083a dummy implementation.
1084
1085=item C<stat>
1086
1087C<os2_stat> special-cases F</dev/tty> and F</dev/con>.
1088
1089=back
1090
a56dbb1c 1091=head1 Perl flavors
615d1a09 1092
72ea3524 1093Because of idiosyncrasies of OS/2 one cannot have all the eggs in the
a56dbb1c
PP
1094same basket (though C<EMX> environment tries hard to overcome this
1095limitations, so the situation may somehow improve). There are 4
1096executables for Perl provided by the distribution:
615d1a09 1097
a56dbb1c 1098=head2 F<perl.exe>
615d1a09 1099
a56dbb1c
PP
1100The main workhorse. This is a chimera executable: it is compiled as an
1101C<a.out>-style executable, but is linked with C<omf>-style dynamic
1102library F<perl.dll>, and with dynamic B<CRT> DLL. This executable is a
1103C<VIO> application.
1104
1105It can load perl dynamic extensions, and it can fork(). Unfortunately,
72ea3524
IZ
1106with the current version of B<EMX> it cannot fork() with dynamic
1107extensions loaded (may be fixed by patches to B<EMX>).
a56dbb1c
PP
1108
1109B<Note.> Keep in mind that fork() is needed to open a pipe to yourself.
1110
1111=head2 F<perl_.exe>
1112
1113This is a statically linked C<a.out>-style executable. It can fork(),
1114but cannot load dynamic Perl extensions. The supplied executable has a
1115lot of extensions prebuilt, thus there are situations when it can
1116perform tasks not possible using F<perl.exe>, like fork()ing when
1117having some standard extension loaded. This executable is a C<VIO>
1118application.
1119
1120B<Note.> A better behaviour could be obtained from C<perl.exe> if it
1121were statically linked with standard I<Perl extensions>, but
1122dynamically linked with the I<Perl DLL> and C<CRT> DLL. Then it would
1123be able to fork() with standard extensions, I<and> would be able to
1124dynamically load arbitrary extensions. Some changes to Makefiles and
1125hint files should be necessary to achieve this.
1126
1127I<This is also the only executable with does not require OS/2.> The
1128friends locked into C<M$> world would appreciate the fact that this
72ea3524 1129executable runs under DOS, Win0.3*, Win0.95 and WinNT with an
a56dbb1c
PP
1130appropriate extender. See L<"Other OSes">.
1131
1132=head2 F<perl__.exe>
1133
1134This is the same executable as <perl___.exe>, but it is a C<PM>
1135application.
1136
1137B<Note.> Usually C<STDIN>, C<STDERR>, and C<STDOUT> of a C<PM>
1138application are redirected to C<nul>. However, it is possible to see
1139them if you start C<perl__.exe> from a PM program which emulates a
1140console window, like I<Shell mode> of C<Emacs> or C<EPM>. Thus it I<is
1141possible> to use Perl debugger (see L<perldebug>) to debug your PM
1142application.
1143
1144This flavor is required if you load extensions which use C<PM>, like
1145the forthcoming C<Perl/Tk>.
1146
1147=head2 F<perl___.exe>
1148
1149This is an C<omf>-style executable which is dynamically linked to
1150F<perl.dll> and C<CRT> DLL. I know no advantages of this executable
1151over C<perl.exe>, but it cannot fork() at all. Well, one advantage is
1152that the build process is not so convoluted as with C<perl.exe>.
1153
1154It is a C<VIO> application.
1155
1156=head2 Why strange names?
1157
1158Since Perl processes the C<#!>-line (cf.
1159L<perlrun/DESCRIPTION>, L<perlrun/Switches>,
1160L<perldiag/"Not a perl script">,
1161L<perldiag/"No Perl script found in input">), it should know when a
1162program I<is a Perl>. There is some naming convention which allows
1163Perl to distinguish correct lines from wrong ones. The above names are
72ea3524 1164almost the only names allowed by this convention which do not contain
a56dbb1c
PP
1165digits (which have absolutely different semantics).
1166
1167=head2 Why dynamic linking?
1168
1169Well, having several executables dynamically linked to the same huge
1170library has its advantages, but this would not substantiate the
1171additional work to make it compile. The reason is stupid-but-quick
1172"hard" dynamic linking used by OS/2.
1173
72ea3524
IZ
1174The address tables of DLLs are patched only once, when they are
1175loaded. The addresses of entry points into DLLs are guaranteed to be
a56dbb1c
PP
1176the same for all programs which use the same DLL, which reduces the
1177amount of runtime patching - once DLL is loaded, its code is
1178read-only.
1179
1180While this allows some performance advantages, this makes life
72ea3524 1181terrible for developers, since the above scheme makes it impossible
a56dbb1c
PP
1182for a DLL to be resolved to a symbol in the .EXE file, since this
1183would need a DLL to have different relocations tables for the
1184executables which use it.
1185
1186However, a Perl extension is forced to use some symbols from the perl
1187executable, say to know how to find the arguments provided on the perl
1188internal evaluation stack. The solution is that the main code of
1189interpreter should be contained in a DLL, and the F<.EXE> file just loads
1190this DLL into memory and supplies command-arguments.
1191
72ea3524 1192This I<greatly> increases the load time for the application (as well as
a56dbb1c
PP
1193the number of problems during compilation). Since interpreter is in a DLL,
1194the C<CRT> is basically forced to reside in a DLL as well (otherwise
1195extensions would not be able to use C<CRT>).
1196
1197=head2 Why chimera build?
1198
1199Current C<EMX> environment does not allow DLLs compiled using Unixish
1200C<a.out> format to export symbols for data. This forces C<omf>-style
1201compile of F<perl.dll>.
1202
1203Current C<EMX> environment does not allow F<.EXE> files compiled in
1204C<omf> format to fork(). fork() is needed for exactly three Perl
1205operations:
1206
1207=over 4
1208
1209=item explicit fork()
1210
1211in the script, and
1212
1213=item open FH, "|-"
1214
1215=item open FH, "-|"
1216
1217opening pipes to itself.
1218
1219=back
1220
1221While these operations are not questions of life and death, a lot of
1222useful scripts use them. This forces C<a.out>-style compile of
1223F<perl.exe>.
1224
1225
1226=head1 ENVIRONMENT
1227
1228Here we list environment variables with are either OS/2-specific, or
1229are more important under OS/2 than under other OSes.
1230
1231=head2 C<PERLLIB_PREFIX>
1232
1233Specific for OS/2. Should have the form
1234
1235 path1;path2
1236
1237or
1238
1239 path1 path2
1240
1241If the beginning of some prebuilt path matches F<path1>, it is
1242substituted with F<path2>.
1243
1244Should be used if the perl library is moved from the default
1245location in preference to C<PERL(5)LIB>, since this would not leave wrong
1246entries in <@INC>.
1247
1248=head2 C<PERL_BADLANG>
1249
1250If 1, perl ignores setlocale() failing. May be useful with some
1251strange I<locale>s.
1252
1253=head2 C<PERL_BADFREE>
1254
1255If 1, perl would not warn of in case of unwarranted free(). May be
1256useful in conjunction with the module DB_File, since Berkeley DB
1257memory handling code is buggy.
1258
1259=head2 C<PERL_SH_DIR>
1260
1261Specific for OS/2. Gives the directory part of the location for
1262F<sh.exe>.
1263
1264=head2 C<TMP> or C<TEMP>
1265
1266Specific for OS/2. Used as storage place for temporary files, most
1267notably C<-e> scripts.
1268
1269=head1 Evolution
1270
1271Here we list major changes which could make you by surprise.
1272
1273=head2 Priorities
1274
1275C<setpriority> and C<getpriority> are not compatible with earlier
1276ports by Andreas Kaiser. See C<"setpriority, getpriority">.
1277
72ea3524 1278=head2 DLL name mangling
a56dbb1c
PP
1279
1280With the release 5.003_01 the dynamically loadable libraries
1281should be rebuilt. In particular, DLLs are now created with the names
1282which contain a checksum, thus allowing workaround for OS/2 scheme of
1283caching DLLs.
1284
1285=head2 Threading
1286
1287As of release 5.003_01 perl is linked to multithreaded C<CRT>
1288DLL. Perl itself is not multithread-safe, as is not perl
1289malloc(). However, extensions may use multiple thread on their own
1290risk.
1291
1292Needed to compile C<Perl/Tk> for C<XFreeOS/2> out-of-the-box.
1293
1294=head2 Calls to external programs
1295
1296Due to a popular demand the perl external program calling has been
72ea3524 1297changed wrt Andreas Kaiser's port. I<If> perl needs to call an
a56dbb1c
PP
1298external program I<via shell>, the F<f:/bin/sh.exe> will be called, or
1299whatever is the override, see L<"PERL_SH_DIR">.
1300
1301Thus means that you need to get some copy of a F<sh.exe> as well (I
1302use one from pdksh). The drive F: above is set up automatically during
1303the build to a correct value on the builder machine, but is
1304overridable at runtime,
1305
1306B<Reasons:> a consensus on C<perl5-porters> was that perl should use
1307one non-overridable shell per platform. The obvious choices for OS/2
1308are F<cmd.exe> and F<sh.exe>. Having perl build itself would be impossible
1309with F<cmd.exe> as a shell, thus I picked up C<sh.exe>. Thus assures almost
1310100% compatibility with the scripts coming from *nix.
1311
1312B<Disadvantages:> currently F<sh.exe> of C<pdksh> calls external programs
1313via fork()/exec(), and there is I<no> functioning exec() on
1314OS/2. exec() is emulated by EMX by asyncroneous call while the caller
72ea3524 1315waits for child completion (to pretend that the C<pid> did not change). This
a56dbb1c
PP
1316means that 1 I<extra> copy of F<sh.exe> is made active via fork()/exec(),
1317which may lead to some resources taken from the system (even if we do
1318not count extra work needed for fork()ing).
1319
72ea3524
IZ
1320Note that this a lesser issue now when we do not spawn F<sh.exe>
1321unless needed (metachars found).
1322
1323One can always start F<cmd.exe> explicitly via
a56dbb1c
PP
1324
1325 system 'cmd', '/c', 'mycmd', 'arg1', 'arg2', ...
1326
72ea3524 1327If you need to use F<cmd.exe>, and do not want to hand-edit thousands of your
a56dbb1c
PP
1328scripts, the long-term solution proposed on p5-p is to have a directive
1329
1330 use OS2::Cmd;
1331
1332which will override system(), exec(), C<``>, and
1333C<open(,'...|')>. With current perl you may override only system(),
1334readpipe() - the explicit version of C<``>, and maybe exec(). The code
1335will substitute the one-argument call to system() by
1336C<CORE::system('cmd.exe', '/c', shift)>.
1337
1338If you have some working code for C<OS2::Cmd>, please send it to me,
1339I will include it into distribution. I have no need for such a module, so
1340cannot test it.
1341
df3ef7a9
IZ
1342=head2 Memory allocation
1343
1344Perl uses its own malloc() under OS/2 - interpreters are usually malloc-bound
1345for speed, but perl is not, since its malloc is lightning-fast.
1346Unfortunately, it is also quite frivolous with memory usage as well.
1347
1348Since kitchen-top machines are usually low on memory, perl is compiled with
1349all the possible memory-saving options. This probably makes perl's
1350malloc() as greedy with memory as the neighbor's malloc(), but still
1351much quickier. Note that this is true only for a "typical" usage,
1352it is possible that the perl malloc will be worse for some very special usage.
1353
1354Combination of perl's malloc() and rigid DLL name resolution creates
1355a special problem with library functions which expect their return value to
1356be free()d by system's free(). To facilitate extensions which need to call
1357such functions, system memory-allocation functions are still available with
1358the prefix C<emx_> added. (Currently only DLL perl has this, it should
1359propagate to F<perl_.exe> shortly.)
1360
a56dbb1c
PP
1361=cut
1362
1363OS/2 extensions
1364~~~~~~~~~~~~~~~
72ea3524 1365I include 3 extensions by Andreas Kaiser, OS2::REXX, OS2::UPM, and OS2::FTP,
a56dbb1c
PP
1366into my ftp directory, mirrored on CPAN. I made
1367some minor changes needed to compile them by standard tools. I cannot
1368test UPM and FTP, so I will appreciate your feedback. Other extensions
1369there are OS2::ExtAttr, OS2::PrfDB for tied access to EAs and .INI
1370files - and maybe some other extensions at the time you read it.
1371
1372Note that OS2 perl defines 2 pseudo-extension functions
1373OS2::Copy::copy and DynaLoader::mod2fname.
1374
1375The -R switch of older perl is deprecated. If you need to call a REXX code
1376which needs access to variables, include the call into a REXX compartment
1377created by
1378 REXX_call {...block...};
1379
1380Two new functions are supported by REXX code,
1381 REXX_eval 'string';
1382 REXX_eval_with 'string', REXX_function_name => \&perl_sub_reference;
1383
1384If you have some other extensions you want to share, send the code to
1385me. At least two are available: tied access to EA's, and tied access
1386to system databases.
615d1a09 1387
a56dbb1c 1388=head1 AUTHOR
615d1a09 1389
a56dbb1c 1390Ilya Zakharevich, ilya@math.ohio-state.edu
615d1a09 1391
a56dbb1c 1392=head1 SEE ALSO
615d1a09 1393
a56dbb1c 1394perl(1).
615d1a09 1395
a56dbb1c 1396=cut
615d1a09 1397