| 1 | .\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32 |
| 2 | .\" |
| 3 | .\" Standard preamble: |
| 4 | .\" ======================================================================== |
| 5 | .de Sh \" Subsection heading |
| 6 | .br |
| 7 | .if t .Sp |
| 8 | .ne 5 |
| 9 | .PP |
| 10 | \fB\\$1\fR |
| 11 | .PP |
| 12 | .. |
| 13 | .de Sp \" Vertical space (when we can't use .PP) |
| 14 | .if t .sp .5v |
| 15 | .if n .sp |
| 16 | .. |
| 17 | .de Vb \" Begin verbatim text |
| 18 | .ft CW |
| 19 | .nf |
| 20 | .ne \\$1 |
| 21 | .. |
| 22 | .de Ve \" End verbatim text |
| 23 | .ft R |
| 24 | .fi |
| 25 | .. |
| 26 | .\" Set up some character translations and predefined strings. \*(-- will |
| 27 | .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left |
| 28 | .\" double quote, and \*(R" will give a right double quote. | will give a |
| 29 | .\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to |
| 30 | .\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C' |
| 31 | .\" expand to `' in nroff, nothing in troff, for use with C<>. |
| 32 | .tr \(*W-|\(bv\*(Tr |
| 33 | .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' |
| 34 | .ie n \{\ |
| 35 | . ds -- \(*W- |
| 36 | . ds PI pi |
| 37 | . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch |
| 38 | . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch |
| 39 | . ds L" "" |
| 40 | . ds R" "" |
| 41 | . ds C` "" |
| 42 | . ds C' "" |
| 43 | 'br\} |
| 44 | .el\{\ |
| 45 | . ds -- \|\(em\| |
| 46 | . ds PI \(*p |
| 47 | . ds L" `` |
| 48 | . ds R" '' |
| 49 | 'br\} |
| 50 | .\" |
| 51 | .\" If the F register is turned on, we'll generate index entries on stderr for |
| 52 | .\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index |
| 53 | .\" entries marked with X<> in POD. Of course, you'll have to process the |
| 54 | .\" output yourself in some meaningful fashion. |
| 55 | .if \nF \{\ |
| 56 | . de IX |
| 57 | . tm Index:\\$1\t\\n%\t"\\$2" |
| 58 | .. |
| 59 | . nr % 0 |
| 60 | . rr F |
| 61 | .\} |
| 62 | .\" |
| 63 | .\" For nroff, turn off justification. Always turn off hyphenation; it makes |
| 64 | .\" way too many mistakes in technical documents. |
| 65 | .hy 0 |
| 66 | .if n .na |
| 67 | .\" |
| 68 | .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). |
| 69 | .\" Fear. Run. Save yourself. No user-serviceable parts. |
| 70 | . \" fudge factors for nroff and troff |
| 71 | .if n \{\ |
| 72 | . ds #H 0 |
| 73 | . ds #V .8m |
| 74 | . ds #F .3m |
| 75 | . ds #[ \f1 |
| 76 | . ds #] \fP |
| 77 | .\} |
| 78 | .if t \{\ |
| 79 | . ds #H ((1u-(\\\\n(.fu%2u))*.13m) |
| 80 | . ds #V .6m |
| 81 | . ds #F 0 |
| 82 | . ds #[ \& |
| 83 | . ds #] \& |
| 84 | .\} |
| 85 | . \" simple accents for nroff and troff |
| 86 | .if n \{\ |
| 87 | . ds ' \& |
| 88 | . ds ` \& |
| 89 | . ds ^ \& |
| 90 | . ds , \& |
| 91 | . ds ~ ~ |
| 92 | . ds / |
| 93 | .\} |
| 94 | .if t \{\ |
| 95 | . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" |
| 96 | . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' |
| 97 | . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' |
| 98 | . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' |
| 99 | . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' |
| 100 | . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' |
| 101 | .\} |
| 102 | . \" troff and (daisy-wheel) nroff accents |
| 103 | .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' |
| 104 | .ds 8 \h'\*(#H'\(*b\h'-\*(#H' |
| 105 | .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] |
| 106 | .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' |
| 107 | .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' |
| 108 | .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] |
| 109 | .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] |
| 110 | .ds ae a\h'-(\w'a'u*4/10)'e |
| 111 | .ds Ae A\h'-(\w'A'u*4/10)'E |
| 112 | . \" corrections for vroff |
| 113 | .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' |
| 114 | .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' |
| 115 | . \" for low resolution devices (crt and lpr) |
| 116 | .if \n(.H>23 .if \n(.V>19 \ |
| 117 | \{\ |
| 118 | . ds : e |
| 119 | . ds 8 ss |
| 120 | . ds o a |
| 121 | . ds d- d\h'-1'\(ga |
| 122 | . ds D- D\h'-1'\(hy |
| 123 | . ds th \o'bp' |
| 124 | . ds Th \o'LP' |
| 125 | . ds ae ae |
| 126 | . ds Ae AE |
| 127 | .\} |
| 128 | .rm #[ #] #H #V #F C |
| 129 | .\" ======================================================================== |
| 130 | .\" |
| 131 | .IX Title "PERLWIN32 1" |
| 132 | .TH PERLWIN32 1 "2006-01-07" "perl v5.8.8" "Perl Programmers Reference Guide" |
| 133 | .SH "NAME" |
| 134 | perlwin32 \- Perl under Windows\r |
| 135 | .SH "SYNOPSIS" |
| 136 | .IX Header "SYNOPSIS" |
| 137 | These are instructions for building Perl under Windows 9x/NT/2000/XP\r |
| 138 | on the Intel x86 and Itanium architectures.\r |
| 139 | .SH "DESCRIPTION" |
| 140 | .IX Header "DESCRIPTION" |
| 141 | Before you start, you should glance through the \s-1README\s0 file\r |
| 142 | found in the top-level directory to which the Perl distribution\r |
| 143 | was extracted. Make sure you read and understand the terms under\r |
| 144 | which this software is being distributed.\r |
| 145 | .PP |
| 146 | Also make sure you read \*(L"\s-1BUGS\s0 \s-1AND\s0 \s-1CAVEATS\s0\*(R" below for the\r |
| 147 | known limitations of this port.\r |
| 148 | .PP |
| 149 | The \s-1INSTALL\s0 file in the perl top-level has much information that is\r |
| 150 | only relevant to people building Perl on Unix-like systems. In\r |
| 151 | particular, you can safely ignore any information that talks about\r |
| 152 | \&\*(L"Configure\*(R".\r |
| 153 | .PP |
| 154 | You may also want to look at two other options for building\r |
| 155 | a perl that will work on Windows \s-1NT:\s0 the \s-1README\s0.cygwin and\r |
| 156 | \&\s-1README\s0.os2 files, each of which give a different set of rules to\r |
| 157 | build a Perl that will work on Win32 platforms. Those two methods\r |
| 158 | will probably enable you to build a more Unix-compatible perl, but\r |
| 159 | you will also need to download and use various other build-time and\r |
| 160 | run-time support software described in those files.\r |
| 161 | .PP |
| 162 | This set of instructions is meant to describe a so-called \*(L"native\*(R"\r |
| 163 | port of Perl to Win32 platforms. This includes both 32\-bit and\r |
| 164 | 64\-bit Windows operating systems. The resulting Perl requires no\r |
| 165 | additional software to run (other than what came with your operating\r |
| 166 | system). Currently, this port is capable of using one of the\r |
| 167 | following compilers on the Intel x86 architecture:\r |
| 168 | .PP |
| 169 | .Vb 3 |
| 170 | \& Borland C++ version 5.02 or later\r |
| 171 | \& Microsoft Visual C++ version 2.0 or later\r |
| 172 | \& MinGW with gcc gcc version 2.95.2 or later |
| 173 | .Ve |
| 174 | .PP |
| 175 | The last of these is a high quality freeware compiler. Use version\r |
| 176 | 3.2.x or later for the best results with this compiler.\r |
| 177 | .PP |
| 178 | The Borland \*(C+ and Microsoft Visual \*(C+ compilers are also now being given\r |
| 179 | away free. The Borland compiler is available as \*(L"Borland \*(C+ Compiler Free\r |
| 180 | Command Line Tools\*(R" and is the same compiler that ships with the full\r |
| 181 | \&\*(L"Borland \*(C+ Builder\*(R" product. The Microsoft compiler is available as\r |
| 182 | \&\*(L"Visual \*(C+ Toolkit 2003\*(R", and also as part of the \*(L".NET Framework \s-1SDK\s0\*(R", and\r |
| 183 | is the same compiler that ships with \*(L"Visual Studio .NET 2003 Professional\*(R".\r |
| 184 | .PP |
| 185 | This port can also be built on the Intel \s-1IA64\s0 using:\r |
| 186 | .PP |
| 187 | .Vb 1 |
| 188 | \& Microsoft Platform SDK Nov 2001 (64-bit compiler and tools) |
| 189 | .Ve |
| 190 | .PP |
| 191 | The \s-1MS\s0 Platform \s-1SDK\s0 can be downloaded from http://www.microsoft.com/.\r |
| 192 | .PP |
| 193 | This port fully supports MakeMaker (the set of modules that\r |
| 194 | is used to build extensions to perl). Therefore, you should be\r |
| 195 | able to build and install most extensions found in the \s-1CPAN\s0 sites.\r |
| 196 | See \*(L"Usage Hints for Perl on Win32\*(R" below for general hints about this.\r |
| 197 | .Sh "Setting Up Perl on Win32" |
| 198 | .IX Subsection "Setting Up Perl on Win32" |
| 199 | .IP "Make" 4 |
| 200 | .IX Item "Make" |
| 201 | You need a \*(L"make\*(R" program to build the sources. If you are using\r |
| 202 | Visual \*(C+ or the Platform \s-1SDK\s0 tools under Windows \s-1NT/2000/XP\s0, nmake\r |
| 203 | will work. All other builds need dmake.\r |
| 204 | .Sp |
| 205 | dmake is a freely available make that has very nice macro features\r |
| 206 | and parallelability.\r |
| 207 | .Sp |
| 208 | A port of dmake for Windows is available from:\r |
| 209 | .Sp |
| 210 | .Vb 1 |
| 211 | \& http://search.cpan.org/dist/dmake/ |
| 212 | .Ve |
| 213 | .Sp |
| 214 | Fetch and install dmake somewhere on your path.\r |
| 215 | .Sp |
| 216 | There exists a minor coexistence problem with dmake and Borland \*(C+\r |
| 217 | compilers. Namely, if a distribution has C files named with mixed\r |
| 218 | case letters, they will be compiled into appropriate .obj\-files named\r |
| 219 | with all lowercase letters, and every time dmake is invoked\r |
| 220 | to bring files up to date, it will try to recompile such files again.\r |
| 221 | For example, Tk distribution has a lot of such files, resulting in\r |
| 222 | needless recompiles every time dmake is invoked. To avoid this, you\r |
| 223 | may use the script \*(L"sync_ext.pl\*(R" after a successful build. It is\r |
| 224 | available in the win32 subdirectory of the Perl source distribution.\r |
| 225 | .IP "Command Shell" 4 |
| 226 | .IX Item "Command Shell" |
| 227 | Use the default \*(L"cmd\*(R" shell that comes with \s-1NT\s0. Some versions of the\r |
| 228 | popular 4DOS/NT shell have incompatibilities that may cause you trouble.\r |
| 229 | If the build fails under that shell, try building again with the cmd\r |
| 230 | shell.\r |
| 231 | .Sp |
| 232 | The nmake Makefile also has known incompatibilities with the\r |
| 233 | \&\*(L"command.com\*(R" shell that comes with Windows 9x. You will need to\r |
| 234 | use dmake and makefile.mk to build under Windows 9x.\r |
| 235 | .Sp |
| 236 | The surest way to build it is on Windows \s-1NT/2000/XP\s0, using the cmd shell.\r |
| 237 | .Sp |
| 238 | Make sure the path to the build directory does not contain spaces. The\r |
| 239 | build usually works in this circumstance, but some tests will fail.\r |
| 240 | .IP "Borland \*(C+" 4 |
| 241 | .IX Item "Borland " |
| 242 | If you are using the Borland compiler, you will need dmake.\r |
| 243 | (The make that Borland supplies is seriously crippled and will not\r |
| 244 | work for MakeMaker builds.)\r |
| 245 | .Sp |
| 246 | See \*(L"Make\*(R" above.\r |
| 247 | .IP "Microsoft Visual \*(C+" 4 |
| 248 | .IX Item "Microsoft Visual " |
| 249 | The nmake that comes with Visual \*(C+ will suffice for building.\r |
| 250 | You will need to run the \s-1VCVARS32\s0.BAT file, usually found somewhere\r |
| 251 | like C:\eMSDEV4.2\eBIN or C:\eProgram Files\eMicrosoft Visual Studio\eVC98\eBin.\r |
| 252 | This will set your build environment.\r |
| 253 | .Sp |
| 254 | You can also use dmake to build using Visual \*(C+; provided, however,\r |
| 255 | you set \s-1OSRELEASE\s0 to \*(L"microsft\*(R" (or whatever the directory name\r |
| 256 | under which the Visual C dmake configuration lives) in your environment\r |
| 257 | and edit win32/config.vc to change \*(L"make=nmake\*(R" into \*(L"make=dmake\*(R". The\r |
| 258 | latter step is only essential if you want to use dmake as your default\r |
| 259 | make for building extensions using MakeMaker.\r |
| 260 | .IP "Microsoft Visual \*(C+ Toolkit 2003" 4 |
| 261 | .IX Item "Microsoft Visual Toolkit 2003" |
| 262 | This free toolkit contains the same compiler and linker that ship with\r |
| 263 | Visual Studio .NET 2003 Professional, but doesn't contain everything\r |
| 264 | necessary to build Perl.\r |
| 265 | .Sp |
| 266 | You will also need to download the \*(L"Platform \s-1SDK\s0\*(R" (the \*(L"Core \s-1SDK\s0\*(R" and \*(L"\s-1MDAC\s0\r |
| 267 | \&\s-1SDK\s0\*(R" components are required) for header files, libraries and rc.exe, and\r |
| 268 | \&\*(L".NET Framework \s-1SDK\s0\*(R" for more libraries and nmake.exe. Note that the latter\r |
| 269 | (which also includes the free compiler and linker) requires the \*(L".NET\r |
| 270 | Framework Redistributable\*(R" to be installed first. This can be downloaded and\r |
| 271 | installed separately, but is included in the \*(L"Visual \*(C+ Toolkit 2003\*(R" anyway.\r |
| 272 | .Sp |
| 273 | These packages can all be downloaded by searching in the Download Center at\r |
| 274 | http://www.microsoft.com/downloads/search.aspx?displaylang=en. (Providing exact\r |
| 275 | links to these packages has proven a pointless task because the links keep on\r |
| 276 | changing so often.)\r |
| 277 | .Sp |
| 278 | Try to obtain the latest version of the Platform \s-1SDK\s0. Sometimes these packages\r |
| 279 | contain a particular Windows \s-1OS\s0 version in their name, but actually work on\r |
| 280 | other \s-1OS\s0 versions too. For example, the \*(L"Windows Server 2003 \s-1SP1\s0 Platform \s-1SDK\s0\*(R"\r |
| 281 | also runs on Windows \s-1XP\s0 \s-1SP2\s0 and Windows 2000.\r |
| 282 | .Sp |
| 283 | According to the download pages the Toolkit and the .NET Framework \s-1SDK\s0 are only\r |
| 284 | supported on Windows 2000/XP/2003, so trying to use these tools on Windows\r |
| 285 | 95/98/ME and even Windows \s-1NT\s0 probably won't work.\r |
| 286 | .Sp |
| 287 | Install the Toolkit first, then the Platform \s-1SDK\s0, then the .NET Framework \s-1SDK\s0.\r |
| 288 | Setup your environment as follows (assuming default installation locations\r |
| 289 | were chosen):\r |
| 290 | .Sp |
| 291 | .Vb 3 |
| 292 | \& SET PATH=%SystemRoot%\esystem32;%SystemRoot%;C:\eProgram Files\eMicrosoft Visual C++ Toolkit 2003\ebin;C:\eProgram Files\eMicrosoft SDK\eBin;C:\eProgram Files\eMicrosoft.NET\eSDK\ev1.1\eBin\r |
| 293 | \& SET INCLUDE=C:\eProgram Files\eMicrosoft Visual C++ Toolkit 2003\einclude;C:\eProgram Files\eMicrosoft SDK\einclude;C:\eProgram Files\eMicrosoft Visual Studio .NET 2003\eVc7\einclude\r |
| 294 | \& SET LIB=C:\eProgram Files\eMicrosoft Visual C++ Toolkit 2003\elib;C:\eProgram Files\eMicrosoft SDK\elib;C:\eProgram Files\eMicrosoft Visual Studio .NET 2003\eVc7\elib |
| 295 | .Ve |
| 296 | .Sp |
| 297 | Several required files will still be missing:\r |
| 298 | .RS 4 |
| 299 | .IP "*" 4 |
| 300 | cvtres.exe is required by link.exe when using a .res file. It is actually\r |
| 301 | installed by the .NET Framework \s-1SDK\s0, but into a location such as the\r |
| 302 | following:\r |
| 303 | .Sp |
| 304 | .Vb 1 |
| 305 | \& C:\eWINDOWS\eMicrosoft.NET\eFramework\ev1.1.4322 |
| 306 | .Ve |
| 307 | .Sp |
| 308 | Copy it from there to C:\eProgram Files\eMicrosoft SDK\eBin\r |
| 309 | .IP "*" 4 |
| 310 | lib.exe is normally used to build libraries, but link.exe with the /lib\r |
| 311 | option also works, so change win32/config.vc to use it instead:\r |
| 312 | .Sp |
| 313 | Change the line reading:\r |
| 314 | .Sp |
| 315 | .Vb 1 |
| 316 | \& ar='lib' |
| 317 | .Ve |
| 318 | .Sp |
| 319 | to:\r |
| 320 | .Sp |
| 321 | .Vb 1 |
| 322 | \& ar='link /lib' |
| 323 | .Ve |
| 324 | .Sp |
| 325 | It may also be useful to create a batch file called lib.bat in\r |
| 326 | C:\eProgram Files\eMicrosoft Visual \*(C+ Toolkit 2003\ebin containing:\r |
| 327 | .Sp |
| 328 | .Vb 2 |
| 329 | \& @echo off\r |
| 330 | \& link /lib %* |
| 331 | .Ve |
| 332 | .Sp |
| 333 | for the benefit of any naughty C extension modules that you might want to build\r |
| 334 | later which explicitly reference \*(L"lib\*(R" rather than taking their value from\r |
| 335 | \&\f(CW$Config\fR{ar}.\r |
| 336 | .IP "*" 4 |
| 337 | setargv.obj is required to build perlglob.exe (and perl.exe if the \s-1USE_SETARGV\s0\r |
| 338 | option is enabled). The Platform \s-1SDK\s0 supplies this object file in source form\r |
| 339 | in C:\eProgram Files\eMicrosoft SDK\esrc\ecrt. Copy setargv.c, cruntime.h and\r |
| 340 | internal.h from there to some temporary location and build setargv.obj using\r |
| 341 | .Sp |
| 342 | .Vb 1 |
| 343 | \& cl.exe /c /I. /D_CRTBLD setargv.c |
| 344 | .Ve |
| 345 | .Sp |
| 346 | Then copy setargv.obj to C:\eProgram Files\eMicrosoft SDK\elib\r |
| 347 | .Sp |
| 348 | Alternatively, if you don't need perlglob.exe and don't need to enable the\r |
| 349 | \&\s-1USE_SETARGV\s0 option then you can safely just remove all mention of $(\s-1GLOBEXE\s0)\r |
| 350 | from win32/Makefile and setargv.obj won't be required anyway.\r |
| 351 | .RE |
| 352 | .RS 4 |
| 353 | .Sp |
| 354 | Perl should now build using the win32/Makefile. You will need to edit that\r |
| 355 | file to set\r |
| 356 | .Sp |
| 357 | .Vb 1 |
| 358 | \& CCTYPE = MSVC70FREE |
| 359 | .Ve |
| 360 | .Sp |
| 361 | and to set \s-1CCHOME\s0, \s-1CCINCDIR\s0 and \s-1CCLIBDIR\s0 as per the environment setup above.\r |
| 362 | .RE |
| 363 | .IP "Microsoft Platform \s-1SDK\s0 64\-bit Compiler" 4 |
| 364 | .IX Item "Microsoft Platform SDK 64-bit Compiler" |
| 365 | The nmake that comes with the Platform \s-1SDK\s0 will suffice for building\r |
| 366 | Perl. Make sure you are building within one of the \*(L"Build Environment\*(R"\r |
| 367 | shells available after you install the Platform \s-1SDK\s0 from the Start Menu.\r |
| 368 | .IP "MinGW release 3 with gcc" 4 |
| 369 | .IX Item "MinGW release 3 with gcc" |
| 370 | The latest release of MinGW at the time of writing is 3.1.0, which contains\r |
| 371 | gcc\-3.2.3. It can be downloaded here:\r |
| 372 | .Sp |
| 373 | .Vb 1 |
| 374 | \& http://www.mingw.org/ |
| 375 | .Ve |
| 376 | .Sp |
| 377 | Perl also compiles with earlier releases of gcc (2.95.2 and up). See below\r |
| 378 | for notes about using earlier versions of MinGW/gcc.\r |
| 379 | .Sp |
| 380 | You also need dmake. See \*(L"Make\*(R" above on how to get it.\r |
| 381 | .IP "MinGW release 1 with gcc" 4 |
| 382 | .IX Item "MinGW release 1 with gcc" |
| 383 | The MinGW\-1.1 bundle contains gcc\-2.95.3.\r |
| 384 | .Sp |
| 385 | Make sure you install the binaries that work with \s-1MSVCRT\s0.DLL as indicated\r |
| 386 | in the \s-1README\s0 for the \s-1GCC\s0 bundle. You may need to set up a few environment\r |
| 387 | variables (usually ran from a batch file).\r |
| 388 | .Sp |
| 389 | There are a couple of problems with the version of gcc\-2.95.2\-msvcrt.exe\r |
| 390 | released 7 November 1999:\r |
| 391 | .RS 4 |
| 392 | .IP "*" 4 |
| 393 | It left out a fix for certain command line quotes. To fix this, be sure\r |
| 394 | to download and install the file fixes/quote\-fix\-msvcrt.exe from the above\r |
| 395 | ftp location.\r |
| 396 | .IP "*" 4 |
| 397 | The definition of the fpos_t type in stdio.h may be wrong. If your\r |
| 398 | stdio.h has this problem, you will see an exception when running the\r |
| 399 | test t/lib/io_xs.t. To fix this, change the typedef for fpos_t from\r |
| 400 | \&\*(L"long\*(R" to \*(L"long long\*(R" in the file i386\-mingw32msvc/include/stdio.h,\r |
| 401 | and rebuild.\r |
| 402 | .RE |
| 403 | .RS 4 |
| 404 | .Sp |
| 405 | A potentially simpler to install (but probably soon\-to\-be\-outdated) bundle\r |
| 406 | of the above package with the mentioned fixes already applied is available\r |
| 407 | here:\r |
| 408 | .Sp |
| 409 | .Vb 2 |
| 410 | \& http://downloads.ActiveState.com/pub/staff/gsar/gcc-2.95.2-msvcrt.zip\r |
| 411 | \& ftp://ftp.ActiveState.com/pub/staff/gsar/gcc-2.95.2-msvcrt.zip |
| 412 | .Ve |
| 413 | .RE |
| 414 | .Sh "Building" |
| 415 | .IX Subsection "Building" |
| 416 | .IP "\(bu" 4 |
| 417 | Make sure you are in the \*(L"win32\*(R" subdirectory under the perl toplevel.\r |
| 418 | This directory contains a \*(L"Makefile\*(R" that will work with\r |
| 419 | versions of nmake that come with Visual \*(C+ or the Platform \s-1SDK\s0, and\r |
| 420 | a dmake \*(L"makefile.mk\*(R" that will work for all supported compilers. The\r |
| 421 | defaults in the dmake makefile are setup to build using MinGW/gcc.\r |
| 422 | .IP "\(bu" 4 |
| 423 | Edit the makefile.mk (or Makefile, if you're using nmake) and change\r |
| 424 | the values of \s-1INST_DRV\s0 and \s-1INST_TOP\s0. You can also enable various\r |
| 425 | build flags. These are explained in the makefiles.\r |
| 426 | .Sp |
| 427 | Note that it is generally not a good idea to try to build a perl with\r |
| 428 | \&\s-1INST_DRV\s0 and \s-1INST_TOP\s0 set to a path that already exists from a previous\r |
| 429 | build. In particular, this may cause problems with the\r |
| 430 | lib/ExtUtils/t/Embed.t test, which attempts to build a test program and\r |
| 431 | may end up building against the installed perl's lib/CORE directory rather\r |
| 432 | than the one being tested.\r |
| 433 | .Sp |
| 434 | You will have to make sure that \s-1CCTYPE\s0 is set correctly and that\r |
| 435 | \&\s-1CCHOME\s0 points to wherever you installed your compiler.\r |
| 436 | .Sp |
| 437 | The default value for \s-1CCHOME\s0 in the makefiles for Visual \*(C+\r |
| 438 | may not be correct for some versions. Make sure the default exists\r |
| 439 | and is valid.\r |
| 440 | .Sp |
| 441 | You may also need to comment out the \f(CW\*(C`DELAYLOAD = ...\*(C'\fR line in the\r |
| 442 | Makefile if you're using \s-1VC++\s0 6.0 without the latest service pack and\r |
| 443 | the linker reports an internal error.\r |
| 444 | .Sp |
| 445 | If you have either the source or a library that contains \fIdes_fcrypt()\fR,\r |
| 446 | enable the appropriate option in the makefile. A ready-to-use version\r |
| 447 | of fcrypt.c, based on the version originally written by Eric Young at\r |
| 448 | ftp://ftp.funet.fi/pub/crypt/mirrors/dsi/libdes/, is bundled with the\r |
| 449 | distribution and \s-1CRYPT_SRC\s0 is set to use it.\r |
| 450 | Alternatively, if you have built a library that contains \fIdes_fcrypt()\fR,\r |
| 451 | you can set \s-1CRYPT_LIB\s0 to point to the library name.\r |
| 452 | Perl will also build without \fIdes_fcrypt()\fR, but the \fIcrypt()\fR builtin will\r |
| 453 | fail at run time.\r |
| 454 | .Sp |
| 455 | If you want build some core extensions statically into perl's dll, specify\r |
| 456 | them in the \s-1STATIC_EXT\s0 macro.\r |
| 457 | .Sp |
| 458 | Be sure to read the instructions near the top of the makefiles carefully.\r |
| 459 | .IP "\(bu" 4 |
| 460 | Type \*(L"dmake\*(R" (or \*(L"nmake\*(R" if you are using that make).\r |
| 461 | .Sp |
| 462 | This should build everything. Specifically, it will create perl.exe,\r |
| 463 | perl58.dll at the perl toplevel, and various other extension dll's\r |
| 464 | under the lib\eauto directory. If the build fails for any reason, make\r |
| 465 | sure you have done the previous steps correctly.\r |
| 466 | .Sh "Testing Perl on Win32" |
| 467 | .IX Subsection "Testing Perl on Win32" |
| 468 | Type \*(L"dmake test\*(R" (or \*(L"nmake test\*(R"). This will run most of the tests from\r |
| 469 | the testsuite (many tests will be skipped).\r |
| 470 | .PP |
| 471 | There should be no test failures when running under Windows \s-1NT/2000/XP\s0.\r |
| 472 | Many tests \fIwill\fR fail under Windows 9x due to the inferior command shell.\r |
| 473 | .PP |
| 474 | Some test failures may occur if you use a command shell other than the\r |
| 475 | native \*(L"cmd.exe\*(R", or if you are building from a path that contains\r |
| 476 | spaces. So don't do that.\r |
| 477 | .PP |
| 478 | If you are running the tests from a emacs shell window, you may see\r |
| 479 | failures in op/stat.t. Run \*(L"dmake test\-notty\*(R" in that case.\r |
| 480 | .PP |
| 481 | If you're using the Borland compiler, you may see a failure in op/taint.t\r |
| 482 | arising from the inability to find the Borland Runtime DLLs on the system\r |
| 483 | default path. You will need to copy the DLLs reported by the messages\r |
| 484 | from where Borland chose to install it, into the Windows system directory\r |
| 485 | (usually somewhere like C:\eWINNT\eSYSTEM32) and rerun the test.\r |
| 486 | .PP |
| 487 | If you're using Borland compiler versions 5.2 and below, you may run into\r |
| 488 | problems finding the correct header files when building extensions. For\r |
| 489 | example, building the \*(L"Tk\*(R" extension may fail because both perl and Tk\r |
| 490 | contain a header file called \*(L"patchlevel.h\*(R". The latest Borland compiler\r |
| 491 | (v5.5) is free of this misbehaviour, and it even supports an\r |
| 492 | option \-VI\- for backward (bugward) compatibility for using the old Borland\r |
| 493 | search algorithm to locate header files.\r |
| 494 | .PP |
| 495 | If you run the tests on a \s-1FAT\s0 partition, you may see some failures for\r |
| 496 | \&\f(CW\*(C`link()\*(C'\fR related tests:\r |
| 497 | .PP |
| 498 | .Vb 1 |
| 499 | \& Failed Test Stat Wstat Total Fail Failed List |
| 500 | .Ve |
| 501 | .PP |
| 502 | .Vb 8 |
| 503 | \& ../ext/IO/lib/IO/t/io_dup.t 6 4 66.67% 2-5\r |
| 504 | \& ../lib/File/Temp/t/mktemp.t 9 1 11.11% 2\r |
| 505 | \& ../lib/File/Temp/t/posix.t 7 1 14.29% 3\r |
| 506 | \& ../lib/File/Temp/t/security.t 13 1 7.69% 2\r |
| 507 | \& ../lib/File/Temp/t/tempfile.t 20 2 10.00% 2 4\r |
| 508 | \& comp/multiline.t 6 2 33.33% 5-6\r |
| 509 | \& io/dup.t 8 6 75.00% 2-7\r |
| 510 | \& op/write.t 47 7 14.89% 1-3 6 9-11 |
| 511 | .Ve |
| 512 | .PP |
| 513 | Testing on \s-1NTFS\s0 avoids these errors.\r |
| 514 | .PP |
| 515 | Furthermore, you should make sure that during \f(CW\*(C`make test\*(C'\fR you do not\r |
| 516 | have any \s-1GNU\s0 tool packages in your path: some toolkits like Unixutils\r |
| 517 | include some tools (\f(CW\*(C`type\*(C'\fR for instance) which override the Windows\r |
| 518 | ones and makes tests fail. Remove them from your path while testing to\r |
| 519 | avoid these errors.\r |
| 520 | .PP |
| 521 | Please report any other failures as described under \*(L"\s-1BUGS\s0 \s-1AND\s0 \s-1CAVEATS\s0\*(R".\r |
| 522 | .Sh "Installation of Perl on Win32" |
| 523 | .IX Subsection "Installation of Perl on Win32" |
| 524 | Type \*(L"dmake install\*(R" (or \*(L"nmake install\*(R"). This will put the newly\r |
| 525 | built perl and the libraries under whatever \f(CW\*(C`INST_TOP\*(C'\fR points to in the\r |
| 526 | Makefile. It will also install the pod documentation under\r |
| 527 | \&\f(CW\*(C`$INST_TOP\e$INST_VER\elib\epod\*(C'\fR and \s-1HTML\s0 versions of the same under\r |
| 528 | \&\f(CW\*(C`$INST_TOP\e$INST_VER\elib\epod\ehtml\*(C'\fR.\r |
| 529 | .PP |
| 530 | To use the Perl you just installed you will need to add a new entry to\r |
| 531 | your \s-1PATH\s0 environment variable: \f(CW\*(C`$INST_TOP\ebin\*(C'\fR, e.g.\r |
| 532 | .PP |
| 533 | .Vb 1 |
| 534 | \& set PATH=c:\eperl\ebin;%PATH% |
| 535 | .Ve |
| 536 | .PP |
| 537 | If you opted to uncomment \f(CW\*(C`INST_VER\*(C'\fR and \f(CW\*(C`INST_ARCH\*(C'\fR in the makefile\r |
| 538 | then the installation structure is a little more complicated and you will\r |
| 539 | need to add two new \s-1PATH\s0 components instead: \f(CW\*(C`$INST_TOP\e$INST_VER\ebin\*(C'\fR and\r |
| 540 | \&\f(CW\*(C`$INST_TOP\e$INST_VER\ebin\e$ARCHNAME\*(C'\fR, e.g.\r |
| 541 | .PP |
| 542 | .Vb 1 |
| 543 | \& set PATH=c:\eperl\e5.6.0\ebin;c:\eperl\e5.6.0\ebin\eMSWin32-x86;%PATH% |
| 544 | .Ve |
| 545 | .Sh "Usage Hints for Perl on Win32" |
| 546 | .IX Subsection "Usage Hints for Perl on Win32" |
| 547 | .IP "Environment Variables" 4 |
| 548 | .IX Item "Environment Variables" |
| 549 | The installation paths that you set during the build get compiled\r |
| 550 | into perl, so you don't have to do anything additional to start\r |
| 551 | using that perl (except add its location to your \s-1PATH\s0 variable).\r |
| 552 | .Sp |
| 553 | If you put extensions in unusual places, you can set \s-1PERL5LIB\s0\r |
| 554 | to a list of paths separated by semicolons where you want perl\r |
| 555 | to look for libraries. Look for descriptions of other environment\r |
| 556 | variables you can set in perlrun.\r |
| 557 | .Sp |
| 558 | You can also control the shell that perl uses to run \fIsystem()\fR and\r |
| 559 | backtick commands via \s-1PERL5SHELL\s0. See perlrun.\r |
| 560 | .Sp |
| 561 | Perl does not depend on the registry, but it can look up certain default\r |
| 562 | values if you choose to put them there. Perl attempts to read entries from\r |
| 563 | \&\f(CW\*(C`HKEY_CURRENT_USER\eSoftware\ePerl\*(C'\fR and \f(CW\*(C`HKEY_LOCAL_MACHINE\eSoftware\ePerl\*(C'\fR.\r |
| 564 | Entries in the former override entries in the latter. One or more of the\r |
| 565 | following entries (of type \s-1REG_SZ\s0 or \s-1REG_EXPAND_SZ\s0) may be set:\r |
| 566 | .Sp |
| 567 | .Vb 7 |
| 568 | \& lib-$] version-specific standard library path to add to @INC\r |
| 569 | \& lib standard library path to add to @INC\r |
| 570 | \& sitelib-$] version-specific site library path to add to @INC\r |
| 571 | \& sitelib site library path to add to @INC\r |
| 572 | \& vendorlib-$] version-specific vendor library path to add to @INC\r |
| 573 | \& vendorlib vendor library path to add to @INC\r |
| 574 | \& PERL* fallback for all %ENV lookups that begin with "PERL" |
| 575 | .Ve |
| 576 | .Sp |
| 577 | Note the \f(CW$]\fR in the above is not literal. Substitute whatever version\r |
| 578 | of perl you want to honor that entry, e.g. \f(CW5.6.0\fR. Paths must be\r |
| 579 | separated with semicolons, as usual on win32.\r |
| 580 | .IP "File Globbing" 4 |
| 581 | .IX Item "File Globbing" |
| 582 | By default, perl handles file globbing using the File::Glob extension,\r |
| 583 | which provides portable globbing.\r |
| 584 | .Sp |
| 585 | If you want perl to use globbing that emulates the quirks of \s-1DOS\s0\r |
| 586 | filename conventions, you might want to consider using File::DosGlob\r |
| 587 | to override the internal \fIglob()\fR implementation. See File::DosGlob for\r |
| 588 | details.\r |
| 589 | .IP "Using perl from the command line" 4 |
| 590 | .IX Item "Using perl from the command line" |
| 591 | If you are accustomed to using perl from various command-line\r |
| 592 | shells found in \s-1UNIX\s0 environments, you will be less than pleased\r |
| 593 | with what Windows offers by way of a command shell.\r |
| 594 | .Sp |
| 595 | The crucial thing to understand about the Windows environment is that\r |
| 596 | the command line you type in is processed twice before Perl sees it.\r |
| 597 | First, your command shell (usually \s-1CMD\s0.EXE on Windows \s-1NT\s0, and\r |
| 598 | \&\s-1COMMAND\s0.COM on Windows 9x) preprocesses the command line, to handle\r |
| 599 | redirection, environment variable expansion, and location of the\r |
| 600 | executable to run. Then, the perl executable splits the remaining\r |
| 601 | command line into individual arguments, using the C runtime library\r |
| 602 | upon which Perl was built.\r |
| 603 | .Sp |
| 604 | It is particularly important to note that neither the shell nor the C\r |
| 605 | runtime do any wildcard expansions of command-line arguments (so\r |
| 606 | wildcards need not be quoted). Also, the quoting behaviours of the\r |
| 607 | shell and the C runtime are rudimentary at best (and may, if you are\r |
| 608 | using a non-standard shell, be inconsistent). The only (useful) quote\r |
| 609 | character is the double quote ("). It can be used to protect spaces\r |
| 610 | and other special characters in arguments.\r |
| 611 | .Sp |
| 612 | The Windows \s-1NT\s0 documentation has almost no description of how the\r |
| 613 | quoting rules are implemented, but here are some general observations\r |
| 614 | based on experiments: The C runtime breaks arguments at spaces and\r |
| 615 | passes them to programs in argc/argv. Double quotes can be used to\r |
| 616 | prevent arguments with spaces in them from being split up. You can\r |
| 617 | put a double quote in an argument by escaping it with a backslash and\r |
| 618 | enclosing the whole argument within double quotes. The backslash and\r |
| 619 | the pair of double quotes surrounding the argument will be stripped by\r |
| 620 | the C runtime.\r |
| 621 | .Sp |
| 622 | The file redirection characters "<\*(L", \*(R">\*(L", and \*(R"|\*(L" can be quoted by\r |
| 623 | double quotes (although there are suggestions that this may not always\r |
| 624 | be true). Single quotes are not treated as quotes by the shell or\r |
| 625 | the C runtime, they don't get stripped by the shell (just to make\r |
| 626 | this type of quoting completely useless). The caret \*(R"^" has also\r |
| 627 | been observed to behave as a quoting character, but this appears\r |
| 628 | to be a shell feature, and the caret is not stripped from the command\r |
| 629 | line, so Perl still sees it (and the C runtime phase does not treat\r |
| 630 | the caret as a quote character).\r |
| 631 | .Sp |
| 632 | Here are some examples of usage of the \*(L"cmd\*(R" shell:\r |
| 633 | .Sp |
| 634 | This prints two doublequotes:\r |
| 635 | .Sp |
| 636 | .Vb 1 |
| 637 | \& perl -e "print '\e"\e"' " |
| 638 | .Ve |
| 639 | .Sp |
| 640 | This does the same:\r |
| 641 | .Sp |
| 642 | .Vb 1 |
| 643 | \& perl -e "print \e"\e\e\e"\e\e\e"\e" " |
| 644 | .Ve |
| 645 | .Sp |
| 646 | This prints \*(L"bar\*(R" and writes \*(L"foo\*(R" to the file \*(L"blurch\*(R":\r |
| 647 | .Sp |
| 648 | .Vb 1 |
| 649 | \& perl -e "print 'foo'; print STDERR 'bar'" > blurch |
| 650 | .Ve |
| 651 | .Sp |
| 652 | This prints \*(L"foo\*(R" (\*(L"bar\*(R" disappears into nowhereland):\r |
| 653 | .Sp |
| 654 | .Vb 1 |
| 655 | \& perl -e "print 'foo'; print STDERR 'bar'" 2> nul |
| 656 | .Ve |
| 657 | .Sp |
| 658 | This prints \*(L"bar\*(R" and writes \*(L"foo\*(R" into the file \*(L"blurch\*(R":\r |
| 659 | .Sp |
| 660 | .Vb 1 |
| 661 | \& perl -e "print 'foo'; print STDERR 'bar'" 1> blurch |
| 662 | .Ve |
| 663 | .Sp |
| 664 | This pipes \*(L"foo\*(R" to the \*(L"less\*(R" pager and prints \*(L"bar\*(R" on the console:\r |
| 665 | .Sp |
| 666 | .Vb 1 |
| 667 | \& perl -e "print 'foo'; print STDERR 'bar'" | less |
| 668 | .Ve |
| 669 | .Sp |
| 670 | This pipes \*(L"foo\enbar\en\*(R" to the less pager:\r |
| 671 | .Sp |
| 672 | .Vb 1 |
| 673 | \& perl -le "print 'foo'; print STDERR 'bar'" 2>&1 | less |
| 674 | .Ve |
| 675 | .Sp |
| 676 | This pipes \*(L"foo\*(R" to the pager and writes \*(L"bar\*(R" in the file \*(L"blurch\*(R":\r |
| 677 | .Sp |
| 678 | .Vb 1 |
| 679 | \& perl -e "print 'foo'; print STDERR 'bar'" 2> blurch | less |
| 680 | .Ve |
| 681 | .Sp |
| 682 | Discovering the usefulness of the \*(L"command.com\*(R" shell on Windows 9x\r |
| 683 | is left as an exercise to the reader :)\r |
| 684 | .Sp |
| 685 | One particularly pernicious problem with the 4NT command shell for\r |
| 686 | Windows \s-1NT\s0 is that it (nearly) always treats a % character as indicating\r |
| 687 | that environment variable expansion is needed. Under this shell, it is\r |
| 688 | therefore important to always double any % characters which you want\r |
| 689 | Perl to see (for example, for hash variables), even when they are\r |
| 690 | quoted.\r |
| 691 | .IP "Building Extensions" 4 |
| 692 | .IX Item "Building Extensions" |
| 693 | The Comprehensive Perl Archive Network (\s-1CPAN\s0) offers a wealth\r |
| 694 | of extensions, some of which require a C compiler to build.\r |
| 695 | Look in http://www.cpan.org/ for more information on \s-1CPAN\s0.\r |
| 696 | .Sp |
| 697 | Note that not all of the extensions available from \s-1CPAN\s0 may work\r |
| 698 | in the Win32 environment; you should check the information at\r |
| 699 | http://testers.cpan.org/ before investing too much effort into\r |
| 700 | porting modules that don't readily build.\r |
| 701 | .Sp |
| 702 | Most extensions (whether they require a C compiler or not) can\r |
| 703 | be built, tested and installed with the standard mantra:\r |
| 704 | .Sp |
| 705 | .Vb 4 |
| 706 | \& perl Makefile.PL\r |
| 707 | \& $MAKE\r |
| 708 | \& $MAKE test\r |
| 709 | \& $MAKE install |
| 710 | .Ve |
| 711 | .Sp |
| 712 | where \f(CW$MAKE\fR is whatever 'make' program you have configured perl to\r |
| 713 | use. Use \*(L"perl \-V:make\*(R" to find out what this is. Some extensions\r |
| 714 | may not provide a testsuite (so \*(L"$MAKE test\*(R" may not do anything or\r |
| 715 | fail), but most serious ones do.\r |
| 716 | .Sp |
| 717 | It is important that you use a supported 'make' program, and\r |
| 718 | ensure Config.pm knows about it. If you don't have nmake, you can\r |
| 719 | either get dmake from the location mentioned earlier or get an\r |
| 720 | old version of nmake reportedly available from:\r |
| 721 | .Sp |
| 722 | .Vb 1 |
| 723 | \& http://download.microsoft.com/download/vc15/Patch/1.52/W95/EN-US/nmake15.exe |
| 724 | .Ve |
| 725 | .Sp |
| 726 | Another option is to use the make written in Perl, available from\r |
| 727 | \&\s-1CPAN\s0.\r |
| 728 | .Sp |
| 729 | .Vb 1 |
| 730 | \& http://www.cpan.org/modules/by-module/Make/ |
| 731 | .Ve |
| 732 | .Sp |
| 733 | You may also use dmake. See \*(L"Make\*(R" above on how to get it.\r |
| 734 | .Sp |
| 735 | Note that MakeMaker actually emits makefiles with different syntax\r |
| 736 | depending on what 'make' it thinks you are using. Therefore, it is\r |
| 737 | important that one of the following values appears in Config.pm:\r |
| 738 | .Sp |
| 739 | .Vb 4 |
| 740 | \& make='nmake' # MakeMaker emits nmake syntax\r |
| 741 | \& make='dmake' # MakeMaker emits dmake syntax\r |
| 742 | \& any other value # MakeMaker emits generic make syntax\r |
| 743 | \& (e.g GNU make, or Perl make) |
| 744 | .Ve |
| 745 | .Sp |
| 746 | If the value doesn't match the 'make' program you want to use,\r |
| 747 | edit Config.pm to fix it.\r |
| 748 | .Sp |
| 749 | If a module implements XSUBs, you will need one of the supported\r |
| 750 | C compilers. You must make sure you have set up the environment for\r |
| 751 | the compiler for command-line compilation.\r |
| 752 | .Sp |
| 753 | If a module does not build for some reason, look carefully for\r |
| 754 | why it failed, and report problems to the module author. If\r |
| 755 | it looks like the extension building support is at fault, report\r |
| 756 | that with full details of how the build failed using the perlbug\r |
| 757 | utility.\r |
| 758 | .IP "Command-line Wildcard Expansion" 4 |
| 759 | .IX Item "Command-line Wildcard Expansion" |
| 760 | The default command shells on \s-1DOS\s0 descendant operating systems (such\r |
| 761 | as they are) usually do not expand wildcard arguments supplied to\r |
| 762 | programs. They consider it the application's job to handle that.\r |
| 763 | This is commonly achieved by linking the application (in our case,\r |
| 764 | perl) with startup code that the C runtime libraries usually provide.\r |
| 765 | However, doing that results in incompatible perl versions (since the\r |
| 766 | behavior of the argv expansion code differs depending on the\r |
| 767 | compiler, and it is even buggy on some compilers). Besides, it may\r |
| 768 | be a source of frustration if you use such a perl binary with an\r |
| 769 | alternate shell that *does* expand wildcards.\r |
| 770 | .Sp |
| 771 | Instead, the following solution works rather well. The nice things\r |
| 772 | about it are 1) you can start using it right away; 2) it is more\r |
| 773 | powerful, because it will do the right thing with a pattern like\r |
| 774 | */*/*.c; 3) you can decide whether you do/don't want to use it; and\r |
| 775 | 4) you can extend the method to add any customizations (or even\r |
| 776 | entirely different kinds of wildcard expansion).\r |
| 777 | .Sp |
| 778 | .Vb 20 |
| 779 | \& C:\e> copy con c:\eperl\elib\eWild.pm\r |
| 780 | \& # Wild.pm - emulate shell @ARGV expansion on shells that don't\r |
| 781 | \& use File::DosGlob;\r |
| 782 | \& @ARGV = map {\r |
| 783 | \& my @g = File::DosGlob::glob($_) if /[*?]/;\r |
| 784 | \& @g ? @g : $_;\r |
| 785 | \& } @ARGV;\r |
| 786 | \& 1;\r |
| 787 | \& ^Z\r |
| 788 | \& C:\e> set PERL5OPT=-MWild\r |
| 789 | \& C:\e> perl -le "for (@ARGV) { print }" */*/perl*.c\r |
| 790 | \& p4view/perl/perl.c\r |
| 791 | \& p4view/perl/perlio.c\r |
| 792 | \& p4view/perl/perly.c\r |
| 793 | \& perl5.005/win32/perlglob.c\r |
| 794 | \& perl5.005/win32/perllib.c\r |
| 795 | \& perl5.005/win32/perlglob.c\r |
| 796 | \& perl5.005/win32/perllib.c\r |
| 797 | \& perl5.005/win32/perlglob.c\r |
| 798 | \& perl5.005/win32/perllib.c |
| 799 | .Ve |
| 800 | .Sp |
| 801 | Note there are two distinct steps there: 1) You'll have to create\r |
| 802 | Wild.pm and put it in your perl lib directory. 2) You'll need to\r |
| 803 | set the \s-1PERL5OPT\s0 environment variable. If you want argv expansion\r |
| 804 | to be the default, just set \s-1PERL5OPT\s0 in your default startup\r |
| 805 | environment.\r |
| 806 | .Sp |
| 807 | If you are using the Visual C compiler, you can get the C runtime's\r |
| 808 | command line wildcard expansion built into perl binary. The resulting\r |
| 809 | binary will always expand unquoted command lines, which may not be\r |
| 810 | what you want if you use a shell that does that for you. The expansion\r |
| 811 | done is also somewhat less powerful than the approach suggested above.\r |
| 812 | .IP "Win32 Specific Extensions" 4 |
| 813 | .IX Item "Win32 Specific Extensions" |
| 814 | A number of extensions specific to the Win32 platform are available\r |
| 815 | from \s-1CPAN\s0. You may find that many of these extensions are meant to\r |
| 816 | be used under the Activeware port of Perl, which used to be the only\r |
| 817 | native port for the Win32 platform. Since the Activeware port does not\r |
| 818 | have adequate support for Perl's extension building tools, these\r |
| 819 | extensions typically do not support those tools either and, therefore,\r |
| 820 | cannot be built using the generic steps shown in the previous section.\r |
| 821 | .Sp |
| 822 | To ensure smooth transitioning of existing code that uses the\r |
| 823 | ActiveState port, there is a bundle of Win32 extensions that contains\r |
| 824 | all of the ActiveState extensions and several other Win32 extensions from\r |
| 825 | \&\s-1CPAN\s0 in source form, along with many added bugfixes, and with MakeMaker\r |
| 826 | support. The latest version of this bundle is available at:\r |
| 827 | .Sp |
| 828 | .Vb 1 |
| 829 | \& http://search.cpan.org/dist/libwin32/ |
| 830 | .Ve |
| 831 | .Sp |
| 832 | See the \s-1README\s0 in that distribution for building and installation\r |
| 833 | instructions.\r |
| 834 | .IP "Notes on 64\-bit Windows" 4 |
| 835 | .IX Item "Notes on 64-bit Windows" |
| 836 | Windows .NET Server supports the \s-1LLP64\s0 data model on the Intel Itanium\r |
| 837 | architecture.\r |
| 838 | .Sp |
| 839 | The \s-1LLP64\s0 data model is different from the \s-1LP64\s0 data model that is the\r |
| 840 | norm on 64\-bit Unix platforms. In the former, \f(CW\*(C`int\*(C'\fR and \f(CW\*(C`long\*(C'\fR are\r |
| 841 | both 32\-bit data types, while pointers are 64 bits wide. In addition,\r |
| 842 | there is a separate 64\-bit wide integral type, \f(CW\*(C`_\|_int64\*(C'\fR. In contrast,\r |
| 843 | the \s-1LP64\s0 data model that is pervasive on Unix platforms provides \f(CW\*(C`int\*(C'\fR\r |
| 844 | as the 32\-bit type, while both the \f(CW\*(C`long\*(C'\fR type and pointers are of\r |
| 845 | 64\-bit precision. Note that both models provide for 64\-bits of\r |
| 846 | addressability.\r |
| 847 | .Sp |
| 848 | 64\-bit Windows running on Itanium is capable of running 32\-bit x86\r |
| 849 | binaries transparently. This means that you could use a 32\-bit build\r |
| 850 | of Perl on a 64\-bit system. Given this, why would one want to build\r |
| 851 | a 64\-bit build of Perl? Here are some reasons why you would bother:\r |
| 852 | .RS 4 |
| 853 | .IP "*" 4 |
| 854 | A 64\-bit native application will run much more efficiently on\r |
| 855 | Itanium hardware.\r |
| 856 | .IP "*" 4 |
| 857 | There is no 2GB limit on process size.\r |
| 858 | .IP "*" 4 |
| 859 | Perl automatically provides large file support when built under\r |
| 860 | 64\-bit Windows.\r |
| 861 | .IP "*" 4 |
| 862 | Embedding Perl inside a 64\-bit application.\r |
| 863 | .RE |
| 864 | .RS 4 |
| 865 | .RE |
| 866 | .Sh "Running Perl Scripts" |
| 867 | .IX Subsection "Running Perl Scripts" |
| 868 | Perl scripts on \s-1UNIX\s0 use the \*(L"#!\*(R" (a.k.a \*(L"shebang\*(R") line to\r |
| 869 | indicate to the \s-1OS\s0 that it should execute the file using perl.\r |
| 870 | Win32 has no comparable means to indicate arbitrary files are\r |
| 871 | executables.\r |
| 872 | .PP |
| 873 | Instead, all available methods to execute plain text files on\r |
| 874 | Win32 rely on the file \*(L"extension\*(R". There are three methods\r |
| 875 | to use this to execute perl scripts:\r |
| 876 | .IP "1" 8 |
| 877 | .IX Item "1" |
| 878 | There is a facility called \*(L"file extension associations\*(R" that will\r |
| 879 | work in Windows \s-1NT\s0 4.0. This can be manipulated via the two\r |
| 880 | commands \*(L"assoc\*(R" and \*(L"ftype\*(R" that come standard with Windows \s-1NT\s0\r |
| 881 | 4.0. Type \*(L"ftype /?\*(R" for a complete example of how to set this\r |
| 882 | up for perl scripts (Say what? You thought Windows \s-1NT\s0 wasn't\r |
| 883 | perl\-ready? :).\r |
| 884 | .IP "2" 8 |
| 885 | .IX Item "2" |
| 886 | Since file associations don't work everywhere, and there are\r |
| 887 | reportedly bugs with file associations where it does work, the\r |
| 888 | old method of wrapping the perl script to make it look like a\r |
| 889 | regular batch file to the \s-1OS\s0, may be used. The install process\r |
| 890 | makes available the \*(L"pl2bat.bat\*(R" script which can be used to wrap\r |
| 891 | perl scripts into batch files. For example:\r |
| 892 | .Sp |
| 893 | .Vb 1 |
| 894 | \& pl2bat foo.pl |
| 895 | .Ve |
| 896 | .Sp |
| 897 | will create the file \*(L"\s-1FOO\s0.BAT\*(R". Note \*(L"pl2bat\*(R" strips any\r |
| 898 | \&.pl suffix and adds a .bat suffix to the generated file.\r |
| 899 | .Sp |
| 900 | If you use the 4DOS/NT or similar command shell, note that\r |
| 901 | \&\*(L"pl2bat\*(R" uses the \*(L"%*\*(R" variable in the generated batch file to\r |
| 902 | refer to all the command line arguments, so you may need to make\r |
| 903 | sure that construct works in batch files. As of this writing,\r |
| 904 | 4DOS/NT users will need a \*(L"ParameterChar = *\*(R" statement in their\r |
| 905 | 4NT.INI file or will need to execute \*(L"setdos /p*\*(R" in the 4DOS/NT\r |
| 906 | startup file to enable this to work.\r |
| 907 | .IP "3" 8 |
| 908 | .IX Item "3" |
| 909 | Using \*(L"pl2bat\*(R" has a few problems: the file name gets changed,\r |
| 910 | so scripts that rely on \f(CW$0\fR to find what they must do may not\r |
| 911 | run properly; running \*(L"pl2bat\*(R" replicates the contents of the\r |
| 912 | original script, and so this process can be maintenance intensive\r |
| 913 | if the originals get updated often. A different approach that\r |
| 914 | avoids both problems is possible.\r |
| 915 | .Sp |
| 916 | A script called \*(L"runperl.bat\*(R" is available that can be copied\r |
| 917 | to any filename (along with the .bat suffix). For example,\r |
| 918 | if you call it \*(L"foo.bat\*(R", it will run the file \*(L"foo\*(R" when it is\r |
| 919 | executed. Since you can run batch files on Win32 platforms simply\r |
| 920 | by typing the name (without the extension), this effectively\r |
| 921 | runs the file \*(L"foo\*(R", when you type either \*(L"foo\*(R" or \*(L"foo.bat\*(R".\r |
| 922 | With this method, \*(L"foo.bat\*(R" can even be in a different location\r |
| 923 | than the file \*(L"foo\*(R", as long as \*(L"foo\*(R" is available somewhere on\r |
| 924 | the \s-1PATH\s0. If your scripts are on a filesystem that allows symbolic\r |
| 925 | links, you can even avoid copying \*(L"runperl.bat\*(R".\r |
| 926 | .Sp |
| 927 | Here's a diversion: copy \*(L"runperl.bat\*(R" to \*(L"runperl\*(R", and type\r |
| 928 | \&\*(L"runperl\*(R". Explain the observed behavior, or lack thereof. :)\r |
| 929 | Hint: .gnidnats llits er'uoy fi ,\*(L"lrepnur\*(R" eteled :tniH\r |
| 930 | .Sh "Miscellaneous Things" |
| 931 | .IX Subsection "Miscellaneous Things" |
| 932 | A full set of \s-1HTML\s0 documentation is installed, so you should be\r |
| 933 | able to use it if you have a web browser installed on your\r |
| 934 | system.\r |
| 935 | .PP |
| 936 | \&\f(CW\*(C`perldoc\*(C'\fR is also a useful tool for browsing information contained\r |
| 937 | in the documentation, especially in conjunction with a pager\r |
| 938 | like \f(CW\*(C`less\*(C'\fR (recent versions of which have Win32 support). You may\r |
| 939 | have to set the \s-1PAGER\s0 environment variable to use a specific pager.\r |
| 940 | \&\*(L"perldoc \-f foo\*(R" will print information about the perl operator\r |
| 941 | \&\*(L"foo\*(R".\r |
| 942 | .PP |
| 943 | One common mistake when using this port with a \s-1GUI\s0 library like \f(CW\*(C`Tk\*(C'\fR\r |
| 944 | is assuming that Perl's normal behavior of opening a command-line\r |
| 945 | window will go away. This isn't the case. If you want to start a copy\r |
| 946 | of \f(CW\*(C`perl\*(C'\fR without opening a command-line window, use the \f(CW\*(C`wperl\*(C'\fR\r |
| 947 | executable built during the installation process. Usage is exactly\r |
| 948 | the same as normal \f(CW\*(C`perl\*(C'\fR on Win32, except that options like \f(CW\*(C`\-h\*(C'\fR\r |
| 949 | don't work (since they need a command-line window to print to).\r |
| 950 | .PP |
| 951 | If you find bugs in perl, you can run \f(CW\*(C`perlbug\*(C'\fR to create a\r |
| 952 | bug report (you may have to send it manually if \f(CW\*(C`perlbug\*(C'\fR cannot\r |
| 953 | find a mailer on your system).\r |
| 954 | .SH "BUGS AND CAVEATS" |
| 955 | .IX Header "BUGS AND CAVEATS" |
| 956 | Norton AntiVirus interferes with the build process, particularly if\r |
| 957 | set to \*(L"AutoProtect, All Files, when Opened\*(R". Unlike large applications\r |
| 958 | the perl build process opens and modifies a lot of files. Having the\r |
| 959 | the AntiVirus scan each and every one slows build the process significantly.\r |
| 960 | Worse, with PERLIO=stdio the build process fails with peculiar messages\r |
| 961 | as the virus checker interacts badly with miniperl.exe writing configure\r |
| 962 | files (it seems to either catch file part written and treat it as suspicious,\r |
| 963 | or virus checker may have it \*(L"locked\*(R" in a way which inhibits miniperl\r |
| 964 | updating it). The build does complete with\r |
| 965 | .PP |
| 966 | .Vb 1 |
| 967 | \& set PERLIO=perlio |
| 968 | .Ve |
| 969 | .PP |
| 970 | but that may be just luck. Other AntiVirus software may have similar issues.\r |
| 971 | .PP |
| 972 | Some of the built-in functions do not act exactly as documented in\r |
| 973 | perlfunc, and a few are not implemented at all. To avoid\r |
| 974 | surprises, particularly if you have had prior exposure to Perl\r |
| 975 | in other operating environments or if you intend to write code\r |
| 976 | that will be portable to other environments, see perlport\r |
| 977 | for a reasonably definitive list of these differences.\r |
| 978 | .PP |
| 979 | Not all extensions available from \s-1CPAN\s0 may build or work properly\r |
| 980 | in the Win32 environment. See \*(L"Building Extensions\*(R".\r |
| 981 | .PP |
| 982 | Most \f(CW\*(C`socket()\*(C'\fR related calls are supported, but they may not\r |
| 983 | behave as on Unix platforms. See perlport for the full list.\r |
| 984 | Perl requires Winsock2 to be installed on the system. If you're\r |
| 985 | running Win95, you can download Winsock upgrade from here:\r |
| 986 | .PP |
| 987 | http://www.microsoft.com/windows95/downloads/contents/WUAdminTools/S_WUNetworkingTools/W95Sockets2/Default.asp\r |
| 988 | .PP |
| 989 | Later \s-1OS\s0 versions already include Winsock2 support.\r |
| 990 | .PP |
| 991 | Signal handling may not behave as on Unix platforms (where it\r |
| 992 | doesn't exactly \*(L"behave\*(R", either :). For instance, calling \f(CW\*(C`die()\*(C'\fR\r |
| 993 | or \f(CW\*(C`exit()\*(C'\fR from signal handlers will cause an exception, since most\r |
| 994 | implementations of \f(CW\*(C`signal()\*(C'\fR on Win32 are severely crippled.\r |
| 995 | Thus, signals may work only for simple things like setting a flag\r |
| 996 | variable in the handler. Using signals under this port should\r |
| 997 | currently be considered unsupported.\r |
| 998 | .PP |
| 999 | Please send detailed descriptions of any problems and solutions that\r |
| 1000 | you may find to <\fIperlbug@perl.org\fR>, along with the output\r |
| 1001 | produced by \f(CW\*(C`perl \-V\*(C'\fR.\r |
| 1002 | .SH "ACKNOWLEDGEMENTS" |
| 1003 | .IX Header "ACKNOWLEDGEMENTS" |
| 1004 | The use of a camel with the topic of Perl is a trademark\r |
| 1005 | of O'Reilly and Associates, Inc. Used with permission.\r |
| 1006 | .SH "AUTHORS" |
| 1007 | .IX Header "AUTHORS" |
| 1008 | .IP "Gary Ng <71564.1743@CompuServe.COM>" 4 |
| 1009 | .IX Item "Gary Ng <71564.1743@CompuServe.COM>" |
| 1010 | .PD 0 |
| 1011 | .IP "Gurusamy Sarathy <gsar@activestate.com>" 4 |
| 1012 | .IX Item "Gurusamy Sarathy <gsar@activestate.com>" |
| 1013 | .IP "Nick Ing-Simmons <nick@ing\-simmons.net>" 4 |
| 1014 | .IX Item "Nick Ing-Simmons <nick@ing-simmons.net>" |
| 1015 | .IP "Jan Dubois <jand@activestate.com>" 4 |
| 1016 | .IX Item "Jan Dubois <jand@activestate.com>" |
| 1017 | .IP "Steve Hay <steve.hay@uk.radan.com>" 4 |
| 1018 | .IX Item "Steve Hay <steve.hay@uk.radan.com>" |
| 1019 | .PD |
| 1020 | .PP |
| 1021 | This document is maintained by Jan Dubois.\r |
| 1022 | .SH "SEE ALSO" |
| 1023 | .IX Header "SEE ALSO" |
| 1024 | perl\r |
| 1025 | .SH "HISTORY" |
| 1026 | .IX Header "HISTORY" |
| 1027 | This port was originally contributed by Gary Ng around 5.003_24,\r |
| 1028 | and borrowed from the Hip Communications port that was available\r |
| 1029 | at the time. Various people have made numerous and sundry hacks\r |
| 1030 | since then.\r |
| 1031 | .PP |
| 1032 | Borland support was added in 5.004_01 (Gurusamy Sarathy).\r |
| 1033 | .PP |
| 1034 | GCC/mingw32 support was added in 5.005 (Nick Ing\-Simmons).\r |
| 1035 | .PP |
| 1036 | Support for \s-1PERL_OBJECT\s0 was added in 5.005 (ActiveState Tool Corp).\r |
| 1037 | .PP |
| 1038 | Support for \fIfork()\fR emulation was added in 5.6 (ActiveState Tool Corp).\r |
| 1039 | .PP |
| 1040 | Win9x support was added in 5.6 (Benjamin Stuhl).\r |
| 1041 | .PP |
| 1042 | Support for 64\-bit Windows added in 5.8 (ActiveState Corp).\r |
| 1043 | .PP |
| 1044 | Last updated: 30 September 2005\r |