This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
avoid reusing foreach itervar if magic got tacked onto it
[perl5.git] / README.vms
1 Last Revised 21-July-1998 by Dan Sugalski <sugalskd@ous.edu>
2 Originally by Charles Bailey <bailey@newman.upenn.edu>
3
4 * Important safety tip
5
6 The build and install procedures have changed significantly from the 5.004
7 releases! Make sure you read the "Building Perl" and "Installing Perl"
8 sections before you build or install.
9
10 Also note that, as of 5.005, an ANSI C compliant compiler is required to
11 build Perl. Vax C is *not* ANSI compliant, as it died a natural death some
12 time before the standard was set. Therefore Vax C will not compile perl
13 5.005. Sorry about that.
14
15 If you're stuck without Dec C (the Vax C license should be good for Dec C,
16 but the media charges might prohibit an upgrade), consider getting Gnu C
17 instead.
18
19 * Intro
20
21 The VMS port of Perl is as functionally complete as any other Perl port
22 (and as complete as the ports on some Unix systems). The Perl binaries
23 provide all the Perl system calls that are either available under VMS or
24 reasonably emulated. There are some incompatibilites in process handling
25 (e.g the fork/exec model for creating subprocesses doesn't do what you
26 might expect under Unix), mainly because VMS and Unix handle processes and
27 sub-processes very differently.
28
29 There are still some unimplemented system functions, and of coursse we
30 could use modules implementing useful VMS system services, so if you'd like
31 to lend a hand we'd love to have you. Join the Perl Porting Team Now!
32
33 The current sources and build procedures have been tested on a VAX using
34 VaxC and Dec C, and on an AXP using Dec C. If you run into problems with
35 other compilers, please let us know.
36
37 There are issues with varions versions of Dec C, so if you're not running a
38 relatively modern version, check the Dec C issues section later on in this
39 document.
40
41 * Other required software
42
43 In addition to VMS, you'll need:
44         1) A C compiler. Dec C for AXP, or Dec C, or gcc for the VAX.
45         2) A make tool. Dec's MMS (v2.6 or later), or MadGoat's free MMS
46            analog MMK (available from ftp.madgoat.com/madgoat) both work
47            just fine. Gnu Make might work, but it's been so long since
48            anyone's tested it that we're not sure. MMK's free, though, so
49            go ahead and use that.
50
51
52 If you want to include socket support, you'll need a TCP stack and either
53 Dec C, or socket libraries. See the Socket Support topic for more details.
54
55 * Building Perl
56
57 Building perl has two steps, configuration and compilation.
58
59 To configure perl (a necessary first step), issue the command
60
61 @CONFIGURE
62
63 from the top of an unpacked perl directory. You'll be asked a series of
64 questions, and the answers to them (along with the capabilities of your C
65 compiler and network stack) will determine how perl's built.
66
67 If you've got multiple C compilers installed, you'll have your choice of
68 which one to use. Various older versions of Dec C had some gotchas, so if
69 you're using a version older than 5.2, check the Dec C Issues section.
70
71 The configuration script will print out, at the very end, the MMS or MMK
72 command you need to compile perl. Issue it (exactly as printed) to start
73 the build.
74
75 Once you issue your MMS command, sit back and wait. Perl should build and
76 link without a problem. If it doesn't, check the Gotchas to watch out for
77 section. If that doesn't help, send some mail to the VMSPERL mailing list.
78 Instructions are in the Mailing Lists section.
79
80 As a handy shortcut, the command:
81
82 @CONFIGURE "-des"
83
84 (note the quotes and case) will choose reasonable defaults. (It takes Dec C
85 over Gnu C, Dec C sockets over SOCKETSHR sockets, and either over no sockets)
86
87 * Testing Perl
88
89 Once Perl has built cleanly, you need to test it to make sure things work.
90 This step is very important--there are always things that can go wrong
91 somehow and get you a dysfunctional Perl.
92
93 Testing is very easy, though, as there's a full test suite in the perl
94 distribution. To run the tests, enter the *exact* MMS line you used to
95 compile Perl and add the word "test" to the end, like this:
96
97 Compile Command:
98
99 $MMS/Macro=("__AXP__=1","decc=1","DECCRTL_SOCKETS=1")
100
101 Test Command:
102
103 $MMS/Macro=("__AXP__=1","decc=1","DECCRTL_SOCKETS=1") test
104
105 MMS will run all the tests. This may take some time, as there are a lot of
106 tests. If any tests fail, there will be a note made on-screen. At the end
107 of all the tests, a summary of the tests, the number passed and failed, and
108 the time taken will be displayed.
109
110 If any tests fail, it means something's wrong with Perl. If the test suite
111 hangs (some tests can take upwards of two or three minutes, or more if
112 you're on an especially slow machine, depending on you machine speed, so
113 don't be hasty), then the test *after* the last one displayed failed. Don't
114 install Perl unless you're confident that you're OK. Regardless of how
115 confident you are, make a bug report to the VMSPerl mailing list.
116
117 If one or more tests fail, you can get more info on the failure by issuing
118 this command sequence:
119
120 $ @[.VMS]TEST .typ "-v" [.subdir]test.T
121
122 where ".typ" is the file type of the Perl images you just built (if you
123 didn't do anything special, use .EXE), and "[.subdir]test.T" is the test
124 that failed. For example, with a normal Perl build, if the test indicated
125 that [.op]time failed, then you'd do this:
126
127 $ @[.VMS]TEST .EXE "-v" [.OP]TIME.T
128
129 When you send in a bug report for failed tests, please include the output
130 from this command, which is run from the main source directory:
131
132 MCR []MINIPERL "-V"
133
134 Note that "-V" really is a capital V in double quotes. This will dump out a
135 couple of screens worth of config info, and can help us diagnose the problem.
136
137 * Cleaning up and starting fresh
138
139 If you need to recompile from scratch, you have to make sure you clean up
140 first. There's a procedure to do it--enter the *exact* MMS line you used to
141 compile and add "realclean" at the end, like this:
142
143 Compile Command:
144
145 $MMS/Macro=("__AXP__=1","decc=1","DECCRTL_SOCKETS=1")
146
147 Cleanup Command:
148
149 $MMS/Macro=("__AXP__=1","decc=1","DECCRTL_SOCKETS=1") realclean
150
151 If you don't do this, things may behave erratically. They might not, too,
152 so it's best to be sure and do it.
153
154 * Installing Perl
155
156 There are several steps you need to take to get Perl installed and
157 running.
158
159 1) Create a directory somewhere and define the concealed logical PERL_ROOT
160 to point to it. For example, DEFINE/TRANS=(CONC,TERM) PERL_ROOT dka200:[perl.]
161
162 2) Run the install script via:
163
164 MMS install
165
166 or
167
168 MMK install
169
170 If for some reason it complains about target INSTALL being up to date,
171 throw a /FORCE switch on the MMS or MMK command.
172
173 3) Either define the symbol PERL somewhere, such as
174 SYS$MANAGER:SYLOGIN.COM, to be "PERL :== $PERL_ROOT:[000000]PERL.EXE", or
175 install Perl into DCLTABLES.EXE (Check out the section "Installing Perl
176 into DCLTABLES" for more info), or put the image in a directory that's in
177 your DCL$PATH (if you're using VMS 6.2 or higher).
178
179 4) Optionally define the command PERLDOC as 
180 PERLDOC :== "$PERL_ROOT:[000000]PERL PERL_ROOT:[LIB.POD]PERLDOC.COM -T"
181 Note that if you wish to use most as a pager please see
182 ftp://space.mit.edu/pub/davis/ for both most and slang.
183
184 5) Optionally define the command PERLBUG (the Perl bug report generator) as
185 PERLBUG :== "$PERL_ROOT:[000000]PERL PERL_ROOT:[LIB]PERLBUG.COM"
186
187 6) Optionally define the command POD2MAN (Converts POD files to nroff
188 source suitable for converting to man pages. Also quiets complaints during
189 module builds) as
190
191 DEFINE/NOLOG POD2MAN PERL_ROOT:[LIB.POD]POD2MAN.COM
192 POD2MAN :== "$PERL_ROOT:[000000]PERL POD2MAN"
193
194 7) Optionally define the command POD2TEXT (Converts POD files to text,
195 which is required for perldoc -f to work properly) as
196
197 DEFINE/NOLOG POD2TEXT PERL_ROOT:[LIB.POD]POD2TEXT.COM
198 POD2TEXT :== "$PERL_ROOT:[000000]PERL POD2TEXT"
199
200 In all these cases, if you've got PERL defined as a foreign command, you
201 can replace $PERL_ROOT:[000000]PERL with ''perl'. If you've installed perl
202 into DCLTABLES, replace it with just perl.
203
204 * Installing Perl into DCLTABLES
205
206 Execute the following command file to define PERL as a DCL command.
207 You'll need CMKRNL priv to install the new dcltables.exe.
208
209 $ create perl.cld
210 !
211 ! modify to reflect location of your perl.exe
212 !
213 define verb perl
214   image perl_root:[000000]perl.exe
215   cliflags (foreign)
216 $!
217 $ set command perl /table=sys$common:[syslib]dcltables.exe -
218  /output=sys$common:[syslib]dcltables.exe
219 $ install replace sys$common:[syslib]dcltables.exe
220 $ exit
221
222 * Changing compile-time things
223
224 Most of the user-definable features of Perl are enabled or disabled in
225 [.VMS]CONFIG.VMS. There's code in there to Do The Right Thing, but that may
226 end up being the wrong thing for you. Make sure you understand what you're
227 doing, since changes here can get you a busted perl.
228
229 Odds are that there's nothing here to change, unless you're on a version of
230 VMS later than 6.2 and Dec C later than 5.6. Even if you are, the correct
231 values will still be chosen, most likely. Poking around here should be
232 unnecessary.
233
234 The one exception is the various *DIR install locations. Changing those
235 requires changes in genconfig.pl as well. Be really careful if you need to
236 change these,a s they can cause some fairly subtle problems.
237
238 * Extra things in the Perl distribution
239
240 In addition to the standard stuff that gets installed, there are two
241 optional extensions, DCLSYM and STDIO, that are handy. Instructions for
242 these two modules are in [.VMS.EXT.DCLSYM] and [.VMS.EXT.STDIO],
243 respectively.
244
245 * Socket Support
246
247 Perl includes a number of functions for IP sockets, which are available if
248 you choose to compile Perl with socket support. (See the section Compiling
249 Perl for more info on selecting a socket stack) Since IP networking is an
250 optional addition to VMS, there are several different IP stacks
251 available. How well integrated they are into the system depends on the
252 stack, your version of VMS, and the version of your C compiler.
253
254 The most portable solution uses the SOCKETSHR library. In combination with
255 either UCX or NetLib, this supports all the major TCP stacks (Multinet,
256 Pathways, TCPWare, UCX, and CMU) on all versions of VMS Perl runs on, with
257 all the compilers on both VAX and Alpha. The socket interface is also
258 consistent across versions of VMS and C compilers. It has a problem with
259 UDP sockets when used with Multinet, though, so you should be aware of
260 that.
261
262 The other solution available is to use the socket routines built into Dec
263 C. Which routines are available depend on the version of VMS you're
264 running, and require proper UCX emulation by your TCP/IP vendor.
265 Relatively current versions of Multinet, TCPWare, Pathway, and UCX all
266 provide the required libraries--check your manuals or release notes to see
267 if your version is new enough.
268
269 * Reporting Bugs
270
271 If you come across what you think might be a bug in Perl, please report
272 it. There's a script in PERL_ROOT:[UTILS], perlbug, that walks you through
273 the process of creating a bug report. This script includes details of your
274 installation, and is very handy. Completed bug reports should go to
275 PERLBUG@PERL.COM.
276
277 * Gotchas to watch out for
278
279 Probably the single biggest gotcha in compiling Perl is giving the wrong
280 switches to MMS/MMK when you build. Use *exactly* what the configure script
281 prints!
282
283 The next big gotcha is directory depth. Perl can create directories four
284 and five levels deep during the build, so you don't have to be too deep to
285 start to hit the RMS 8 level point. It's best to do a
286 $DEFINE/TRANS=(CONC,TERM) PERLSRC disk:[dir.dir.dir.perldir.]"  (note the
287 trailing period) and $SET DEFAULT PERLSRC:[000000] before building. Perl
288 modules can be just as bad (or worse), so watch out for them, too. The
289 configuration script will warn if it thinks you're too deep.
290
291 Finally, the third thing that bites people is leftover pieces from a failed
292 build. If things go wrong, make sure you do a "(MMK|MMS|make) realclean"
293 before you rebuild.
294
295 * Dec C issues
296
297 Note to DECC users: Some early versions (pre-5.2, some pre-4. If you're Dec
298 C 5.x or higher, with current patches if anym you're fine) of the DECCRTL
299 contained a few bugs which affect Perl performance:
300     - Newlines are lost on I/O through pipes, causing lines to run together.
301       This shows up as RMS RTB errors when reading from a pipe.  You can
302       work around this by having one process write data to a file, and
303       then having the other read the file, instead of the pipe.  This is
304       fixed in version 4 of DECC.
305     - The modf() routine returns a non-integral value for some values above
306       INT_MAX; the Perl "int" operator will return a non-integral value in
307       these cases.  This is fixed in version 4 of DECC.
308     - On the AXP, if SYSNAM privilege is enabled, the CRTL chdir() routine
309       changes the process default device and directory permanently, even
310       though the call specified that the change should not persist after
311       Perl exited.  This is fixed by DEC CSC patch AXPACRT04_061.
312
313 * Mailing Lists
314
315 There are several mailing lists available to the Perl porter. For VMS
316 specific issues (including both Perl questions and installation problems)
317 there is the VMSPERL mailing list. It's usually a low-volume (10-12
318 messages a week) mailing list.
319
320 The subscription address is VMSPERL-REQUEST@NEWMAN.UPENN.EDU. Send a mail
321 message with just the words SUBSCRIBE VMSPERL in the body of the message.
322
323 The VMSPERL mailing list address is VMSPERL@NEWMAN.UPENN.EDU. Any mail
324 sent there gets echoed to all subscribers of the list.
325
326 The Perl5-Porters list is for anyone involved in porting Perl to a
327 platform. This includes you, if you want to participate. It's a high-volume
328 list (60-100 messages a day during active development times), so be sure
329 you want to be there. The subscription address is
330 Perl5-Porters-request@perl.org. Send a message with just the word SUBSCRIBE
331 in the body. The posting address is Perl5-Porters@perl.org.
332
333 * Acknowledgements
334
335 A real big thanks needs to go to Charles Bailey
336 <bailey@newman.upenn.edu>, who is ultimately responsible for Perl 5.004
337 running on VMS. Without him, nothing the rest of us have done would be at
338 all important.
339
340 There are, of course, far too many people involved in the porting and testing
341 of Perl to mention everyone who deserves it, so please forgive us if we've
342 missed someone.  That said, special thanks are due to the following:
343   Tim Adye <T.J.Adye@rl.ac.uk>
344      for the VMS emulations of getpw*()
345   David Denholm <denholm@conmat.phys.soton.ac.uk>
346      for extensive testing and provision of pipe and SocketShr code,
347   Mark Pizzolato <mark@infocomm.com>
348      for the getredirection() code
349   Rich Salz <rsalz@bbn.com>
350      for readdir() and related routines
351   Peter Prymmer <pvhp@lns62.lns.cornell.edu)
352      for extensive testing, as well as development work on
353      configuration and documentation for VMS Perl,
354   Dan Sugalski <sugalsd@stargate.lbcc.cc.or.us>
355      for extensive contributions to recent version support,
356      development of VMS-specific extensions, and dissemination
357      of information about VMS Perl,
358   the Stanford Synchrotron Radiation Laboratory and the
359      Laboratory of Nuclear Studies at Cornell University for
360      the the opportunity to test and develop for the AXP,
361 and to the entire VMSperl group for useful advice and suggestions.  In
362 addition the perl5-porters deserve credit for their creativity and
363 willingness to work with the VMS newcomers.  Finally, the greatest debt of
364 gratitude is due to Larry Wall <larry@wall.org>, for having the ideas which
365 have made our sleepless nights possible.
366
367 Thanks,
368 The VMSperl group