home *** CD-ROM | disk | FTP | other *** search
/ Borland Programmer's Resource / Borland_Programmers_Resource_CD_1995.iso / ntcode / ntperlb / nt / relnotes.txt < prev    next >
Encoding:
Text File  |  1995-05-19  |  21.0 KB  |  519 lines

  1. ---------------------------------------------------------------------------
  2. Perl for NT (based on Perl 4.036)
  3. Release notes 
  4.  
  5. ----------------------------------------------------------------------------
  6. 7/8/93
  7. Second release
  8. ----------------------------------------------------------------------------
  9.  
  10. IMPORTANT CHANGE FROM THE LAST RELEASE!  All of the pre-defined
  11. variables for registry access (such as $HKEY_LOCAL_MACHINE) have been
  12. removed from the interpreter and moved into the file registry.pl. This
  13. file can be accessed by putting a 'require' statment in your perl
  14. script, i.e.:
  15.  
  16.         require "registry.pl";
  17.  
  18. This was due to the large number of constants required for accessing
  19. the registry. Rather than clutter the internals of the interpreter it
  20. was thought easier to move the values into a file and require it when
  21. needed. 
  22.  
  23. This release adds the pre-defined subroutine &Spawn, that creates an
  24. independent process. &Spawn allows creation of processes for
  25. bi-directional communication using pipes. It's usage is:
  26.  
  27.     &Spawn ("cmd /c dir/w", $pid, readHandle, writeHandle, errHandle)
  28.         || die "cannot spawn cmd.exe: $!\n";
  29.  
  30. The read, write, and error handles are optional. If not specified
  31. the new process inherits the creating processes input, output, and
  32. error file handles.
  33.  
  34. The perl scripts regupdat.cmd and uninstal.cmd were added to the
  35. distribution to allow quick modification and removal of perl's keys in 
  36. the NT registry. This is for folks that like to move the installed
  37. version around. They are not normally needed, since the registry keys
  38. are automatically updated by the setup installation procedure.
  39.  
  40. More testing has been done on this release. All the registry access
  41. routines that access keys and values have been tested. The routines
  42. that modify the structure of the registry (&RegLoadKey,
  43. &RegReplaceKey, &RegRestoreKey, &RegSaveKey, and &RegUnloadKey) have
  44. not been tested, since I have yet to discover the NT privledge that a
  45. process needs to modify the registry structure :-(.
  46.  
  47. Some bugs were discovered in the initial release (gasp!) and these
  48. have been fixed. Most were in specifying the size of data items
  49. written to the registry.
  50.  
  51. Error reporting still has problems because there are two sets of error
  52. numbers, one for the C runtime library (CRT) and the other for Win32
  53. functions.  The numbers overlap, so there is no easy way to determine
  54. whether the error came from the CRT or from a Win32 function. Until a
  55. better mechanism is developed, the CRT errors are reported for numbers
  56. that overlap.
  57.  
  58. Some mysterious problem with cmd.exe and command file execution has
  59. required a change in the way perl scripts are executed from command
  60. files. The perl switch '-S' should be removed from the command line
  61. where perl is run. This is a change for build 438 of NT. If you are
  62. running on an earlier version, then the -S switch will still be
  63. required.
  64.  
  65.  
  66. ----------------------------------------------------------------------------
  67. 5/20/93
  68. Initial release
  69. ----------------------------------------------------------------------------
  70.  
  71. This is the initial release of Perl for NT. In addition to winsock
  72. access, this release adds user-defined routines to access the NT
  73. Registry database. For information on how to use the registry access
  74. routines, see the new file registry.txt.
  75.  
  76.  
  77. ----------------------------------------------------------------------------
  78. 5/12/93
  79. Second Beta Release
  80. ----------------------------------------------------------------------------
  81.  
  82. This release of Perl for NT has support for the Winsock sockets
  83. interface. Minimal testing has been done, but this version will
  84. connect to an ftp server and the echo service on my system. See the
  85. sample program sock.cmd in the eg directory. Supported functions are:
  86.  
  87.         accept
  88.         bind
  89.         connect
  90.         getpeername
  91.         getsockname
  92.         getsockopt
  93.         listen
  94.         recv
  95.         send
  96.         setsockopt
  97.         shutdown
  98.         socket
  99.         gethostbyname
  100.         getservbyname
  101.         getprotobyname
  102.         
  103. Remember that Winsock only supported Internet domain sockets. For more
  104. information read the help file "Windows Sockets Help" that is
  105. delivered with the Win32 Software Development Kit.
  106.  
  107. Also, a problem was seen during installation. Some sites haven't
  108. delivered PROGTOOLS and so don't have the unzip.exe executable. To fix
  109. this, the delivery site now has a copy of unzip.exe. When delivering
  110. perl, please copy all of the files from the delivery system
  111. (ajax.b11.ingr.com) to your system, then run the installation script.
  112.  
  113. ----------------------------------------------------------------------------
  114. 5/6/93
  115. First Beta Release
  116. ----------------------------------------------------------------------------
  117.  
  118. This is the first Beta release of the Perl port to Windows NT. Most of
  119. the testing for this release (97.62% ;-) has been done on the March
  120. Beta release of NT. The testing that was done on the December release
  121. turned up some problems in the C runtime library that have not been
  122. solved, so perl on the December release in mostly an unknown quantity.
  123.  
  124. There are not many external differences between this release and the
  125. last Alpha release; mostly just additional tests added to the test
  126. suite.
  127.  
  128. Internally, changes have been made that should speed up script
  129. processing. Process creation for backticks, systems, and opens to/from
  130. piped commands have been optimized so that cmd.exe is not started
  131. unless the command string contains i/o redirection or pipes.
  132.  
  133. For information about differences between the Unix release of Perl and
  134. this release, read the sections of this file starting with "General
  135. Information". For information on what features of perl are supported,
  136. have been tested, etc., see the file status.txt. For example perl
  137. scripts that run under NT, including a script that will make an
  138. existing perl script runnable under NT, see the files in the eg
  139. directory. 
  140.  
  141. ----------------------------------------------------------------------------
  142. 4/28/93
  143. Second Alpha release
  144. ----------------------------------------------------------------------------
  145.  
  146. This release fixes a bug in the initial release and updates the
  147. testing status of features listed in status.txt.  It also renames some
  148. of the scripts in the lib directory to fit the 8.3 file name
  149. restrictions.
  150.  
  151. The following library scripts were renamed:
  152.  
  153.     lib\timelocal.pl  -> lib\timelocl.pl
  154.     lib\shellwords.pl -> lib\shwords.pl
  155.     lib\newgetopt.pl  -> lib\ngetopt.pl
  156.     lib\importenv.pl  -> lib\impenv.pl
  157.     lib\finddepth.pl  -> lib\finddep.pl
  158.     lib\exceptions.pl -> lib\except.pl
  159.  
  160.  
  161. NOTE: This release has only been tested on the March Beta release of
  162. NT. I'll be testing perl on the December release in the next few days
  163. and will determine if it's feasible to make the changes needed to run
  164. on December.  It's possible that there will be two releases, one for 
  165. December and one for March, but that decision will have to be made
  166. based on the amount of work required to create and maintain a December
  167. version.
  168.  
  169. A list of the features in status.txt that have changed from the first
  170. release:  
  171.  
  172.         Command line options:
  173.  
  174.             -a: changed from Untested to Tested
  175.             -i: changed from Untested to Tested
  176.             -S: changed from Untested to Tested
  177.             -U: changed from Untested to NYI
  178.  
  179.         File test operators
  180.  
  181.             -c: changed from Untested to N/A
  182.             -b: changed from Untested to N/A
  183.             -o: changed from Untested to Tested
  184.             -p: changed from Untested to NYI
  185.             -f: changed from Untested to Tested
  186.             -d: changed from Untested to Tested
  187.             -e: changed from Untested to Tested
  188.             -z: changed from Untested to Tested
  189.             -s: changed from Untested to Tested
  190.             -t: changed from Untested to Tested
  191.             -w: changed from Untested to Tested
  192.             -x: changed from Untested to Tested
  193.             -R: changed from Untested to Tested
  194.             -W: changed from Untested to Tested
  195.             -X: changed from Untested to Tested
  196.             -O: changed from Untested to Tested
  197.             -T: changed from Untested to Tested
  198.             -B: changed from Untested to Tested
  199.             -M: changed from Untested to Tested
  200.             -A: changed from Untested to Tested
  201.             -C: changed from Untested to Tested
  202.  
  203.         Literals
  204.  
  205.             Here-Is:: changed from Untested to Tested
  206.  
  207.         Search and Replace Functions
  208.  
  209.             ?<pattern>?: changed from Untested to Tested
  210.             /<pattern>/: changed from Untested to Tested
  211.  
  212.         System Interaction
  213.  
  214.             getlogin: changed from Untested to NYI
  215.  
  216.  
  217.         Arithmetic functions
  218.  
  219.             atan2: changed from Untested to Tested
  220.             sin: changed from Untested to Tested
  221.             sqrt: changed from Untested to Tested
  222.             log: changed from Untested to Tested
  223.             int: changed from Untested to Tested
  224.             cos: changed from Untested to Tested
  225.             exp: changed from Untested to Tested
  226.  
  227.  
  228.         File operations
  229.  
  230.             truncate: changed from NYI to Tested
  231.  
  232.         Input / Output
  233.  
  234.             binmode: changed from Untested to Tested
  235.  
  236.         Miscellaneous
  237.             scalar: changed from Untested to Tested
  238.             wantarray: changed from Untested to Tested
  239.  
  240.         Special Arrays
  241.  
  242.             @INC: changed from Untested to Tested
  243.  
  244.         The Perl Debugger
  245.  
  246.             L: changed from Untested to Tested
  247.             X: changed from Untested to Tested
  248.             S: changed from Untested to Tested
  249.             D: changed from Untested to Tested
  250.             d: changed from Untested to Tested
  251.             w: changed from Untested to Tested
  252.             r: changed from Untested to Tested
  253.  
  254.  
  255.         Environment Variables
  256.  
  257.             PERLLIB: changed from Untested to Tested
  258.  
  259.         Perl Library Routines
  260.  
  261.             abbrev.pl: changed from Untested to Tested
  262.             ctime.pl: changed from Untested to Tested
  263.             find.pl: changed from NYI to Tested
  264.  
  265. Problems that were fixed:
  266.  
  267.         - Fixed default search path for perl library routines to
  268.           contain the drive letter as well as the path. This currently
  269.           is c:\win32app\ingr\perl\lib. Later releases are planned to
  270.           have the ability to be installed on any drive.
  271.  
  272.  
  273. ----------------------------------------------------------------------------
  274. 4/22/93 
  275. First Alpha Release
  276. ---------------------------------------------------------------------------
  277.  
  278. These are the release notes for the Alpha release of Perl for NT. The
  279. port was done by starting with the DOS port, then discarding most of
  280. that and reimplementing the functions required. For a complete list of
  281. the perl features that we plan to support, see the file status.txt.
  282. This file also indicates the testing status of each feature.
  283.  
  284.  
  285. ---------------------------------------------------------------------------
  286. General Information
  287. ---------------------------------------------------------------------------
  288.  
  289. There are some changes in how perl scripts are written and invoked on
  290. NT (versus how they are invoked on Unix).  However, these changes
  291. should not be too radical to make perl unusable for NT. In general be
  292. very careful of things depending on wild card expansion and specifics
  293. of command line arguments (i.e. how /bin/sh, or any shell for that
  294. matter, treats quotes). The NT command interpreter (cmd.exe) does not
  295. treat single quotes in a similar manner as unix shells, in fact it
  296. treats single quotes as just another character.
  297.  
  298. Getting your perl script to execute without explicitly invoking perl
  299. takes some strange contortions. Trying to emulate the Unix sharp-bang
  300. facility (#!) was interesting. Here is an incantation that we've found
  301. to work:
  302.  
  303.     1. Give your perl script a ".cmd" extension. This tells the
  304.        command interpreter (cmd.exe) that it's ok to execute.
  305.        (No, really!).
  306.  
  307.     2. Put the following text at the start of your file:
  308.  
  309.         @rem = '
  310.         @echo off
  311.         perl %0.cmd %1 %2 %3 %4 %5 %6 %7 %8 %9
  312.         goto endofperl
  313.         @rem ';
  314.  
  315.     3. Now type in your perl script.
  316.  
  317.     4. Put the following lines at the end of your perl script
  318.         __END__
  319.         :endofperl
  320.  
  321. The five lines of #2 are both legal perl and legal commands for the
  322. command interpreter, cmd.exe. The first time the file is executed (by
  323. cmd.exe) the command interpreter will interpret the "@rem -'" as a
  324. comment and the "@echo off" as a command to turn off echoing commands.
  325. It will then execute perl with the script name as the first argument
  326. and the parameters to the command file as arguments to perl. When perl
  327. sees the file the first five lines are interpreted as an assignment to
  328. the array @rem. When perl finished executing the perl statements it
  329. will terminate and the goto statememt will be executed by the command
  330. interpreter.
  331.  
  332. The __END__ line of #4 is magic to perl and tells the interpreter that
  333. there is no more legal perl source in the file. The :endofperl is th
  334. target of the command interpreter's goto statement from #2.
  335.  
  336. Make sure that when you run the script, you do so without the
  337. extension, since the %0 parameter to the command interpreter is
  338. exactly what you typed. 
  339.  
  340. It's ugly, but it works. Note that there is a now a perl script in the
  341. eg directory named ntcvt.cmd. It will perform the above steps on an
  342. existing perl script. 
  343.  
  344.  
  345.  
  346.  
  347. ---------------------------------------------------------------------------
  348. Globbing (wildcard expansion)
  349. ---------------------------------------------------------------------------
  350.  
  351. Many scripts depend on a unix shell (sh, ksh, csh, etc) to do wildcard
  352. expansion. This construct is often used in perl scripts:
  353.  
  354.         $srcfiles = `echo *.c src/*.c inc/*.h`;
  355.  
  356. This will not work under NT, because the echo command for the command
  357. interpreter (cmd.exe) does not expand wildcards. The prefered (at
  358. least for the moment ;-) mechanism is globbing (anything between angle
  359. brackets that's not a filehandle is considered to be a pattern to be
  360. globbed). The above example could be translated like this:
  361.  
  362.         $srcfiles = join (" ", <*.c src/*.c inc/*.h>);
  363.  
  364. The glob pattern returns either an array of filenames or the next file
  365. of the list depending on context (page 78 of Programming Perl). In the
  366. above example it returns an array of filenames. If used in a while
  367. loop test it would return a filename for each iteration of the loop.
  368.  
  369. Note that you can use either forward or back slashes for directory
  370. separators, but if you use backslashes, then you must use two of them:
  371.  
  372.         $srcfiles = join (" ", <*.c src\\*.c inc\\*.h>);
  373.  
  374. Remember that whatever directory separator that you use will be in the
  375. strings returned.
  376.  
  377. Another method is to use readdir with grep:
  378.  
  379.         opendir(D, ".") || die "Can't open \".\": $!\n";
  380.         @files = grep (/^.*\.c$/, readdir(D));
  381.         closedir(D);
  382.         $srcfiles = join (" ", @files);
  383.  
  384. Hopefully I'll be able to implement globing in the interpreter later
  385. on, but for now it runs a program named perlglob through a popen'ed
  386. pipe. 
  387.  
  388.  
  389. ---------------------------------------------------------------------------
  390. Processes
  391. ---------------------------------------------------------------------------
  392.  
  393. There are some significant differences in how NT treats processes
  394. versus how Unix treats processes.
  395.  
  396. Process creation is the first big difference. Unix uses the fork(2)
  397. system call to create an new process and the exec(2) system call to
  398. load a new executable into the new processes address space. NT merges
  399. these steps into one operation with the CreateProcess system service.
  400.  
  401. There is no equivalent to the fork operation under NT. For this reason
  402. the perl call 'fork' was not implemented. With the addition of the
  403. &Spawn subroutine, there are now four ways to create a process on NT:
  404. use &Spawn, backticks, the system command, or with the open command.
  405.  
  406. Another difference is process hierarchy and process groups.  NT does
  407. not maintain any relationship between a process and the process that
  408. created it. This throws all of the parent/child relationships used in
  409. Unix out the window. For this reason the perl functions regarding
  410. parent process id and process groups were not implemented. There is
  411. simply no way to determine the creating process id and there is no
  412. tree of processes maintained to allow process groups.
  413.  
  414.  
  415. ---------------------------------------------------------------------------
  416. Users and Groups
  417. ---------------------------------------------------------------------------
  418.  
  419. This is a real rat's nest. Both NT and Unix have the concept of user
  420. id's; the problem is with Unix's notion of real and effective uids. NT
  421. doesn't have this concept, so separate file test operators for real
  422. versus effective uid ownership don't make sense.
  423.  
  424. Groups also pose a problem in this port. At any point in time, a Unix
  425. process is associated with one group; this is it's group id. With NT,
  426. a user (hence a user id) may be a member of several groups
  427. simultaneously. NT processes are associated with a user id, so they
  428. also may be members of several groups.
  429.  
  430.  
  431. ---------------------------------------------------------------------------
  432. Internationalization
  433. ---------------------------------------------------------------------------
  434.  
  435. The current port of perl has no facilities for internationalization.
  436. We are holding off implementing locale support, wide character and
  437. multi-byte character support until we find out what is planned for
  438. Perl 5.  
  439.  
  440.  
  441. ---------------------------------------------------------------------------
  442. System Calls
  443. ---------------------------------------------------------------------------
  444.  
  445. The perl command 'syscall' allows a unix perl script to call an
  446. arbitrary system call by invoking the syscall(2) system call. There is
  447. no corresponding facility within the NT system services. At least I
  448. haven't found it yet. 
  449.  
  450.  
  451. ---------------------------------------------------------------------------
  452. File Systems
  453. ---------------------------------------------------------------------------
  454.  
  455. Due to the differences between the Unix file system concept and the
  456. various file systems implemented on NT, the stat command will act
  457. differently. There are no inodes associated with files on NT file
  458. systems, and since there are no links, the link field is useless. 
  459. For more information on what is returned from the perl command 'stat',
  460. see the help file for the Microsoft C/C++ Runtime Library.
  461.  
  462. The FAT file system has no concept of execute permission and it will
  463. only allow a file to be made read-only (write protected). There is no
  464. means to read-protect a FAT file. This means that the only valid modes
  465. for a FAT file are 0666 (rw-rw-rw) and 0444 (r--r--r--). Be careful
  466. looking at modes returned from stat.
  467.  
  468. The NTFS file system offers more features than the FAT file system,
  469. but I haven't researched it enough to tell how we can take advantage
  470. of it from within perl. As I learn more about NTFS and implement it in
  471. the port, I'll mail out information to the mailing list.
  472.  
  473. NOTE: A new pre-defined varible has been added to perl, $FsType. This
  474. variable contains a string that is the name of the file system type
  475. for the current directory (i.e. FAT, HPFS, or NTFS).
  476.  
  477.  
  478. ---------------------------------------------------------------------------
  479. File Times
  480. ---------------------------------------------------------------------------
  481. The stat and utime calls seem to have difficulties with Daylight
  482. Savings Time. The following perl script fails:
  483.  
  484.         open (B, ">b") || die "Can't open b for output: $!\n";
  485.         print B "foo\n";
  486.         close B;
  487.         $foo = (utime 500000000,500000001,'b');
  488.         ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
  489.          $atime,$mtime,$ctime,$blksize,$blocks) = stat('b');
  490.         print "stat reports times as:\n";
  491.         print "   atime: $atime ", &ctime($atime);
  492.         print "   mtime: $mtime ", &ctime($mtime);
  493.  
  494. Instead of the atime and mtime being 500000000 and 500000001 as you
  495. would expect, they are off by one hour (500003600 and 500003601). This
  496. looks like a C/C++ runtime library problem. For the moment, use utime
  497. cautiously. We'll try to find a work around while we're waiting for
  498. Microsoft to fix the problem(s).
  499.  
  500.  
  501. ---------------------------------------------------------------------------
  502. Command line arguments
  503. ---------------------------------------------------------------------------
  504.  
  505. Be careful when porting a perl script that uses the shell's echo
  506. command. Besides the problems of wildcard expansion (listed above
  507. under Globbing), cmd.exe does not strip white space like a unix shell.
  508. The following script illustrates a problem discovered in the Perl Test
  509. Suite:
  510.  
  511.     $x = `echo foo | perl -e "while (<>) {print $_;}" Ioargv.tmp -`;
  512.  
  513.     if ($x eq "a line\nfoo\n") {print "ok 2\n";} else {print "not ok 2\n";}
  514.  
  515. The script failed because of the space between 'foo' and '|' on the
  516. first line. The echo command echo's EVERYTHING up to the pipe or
  517. redirection or end-of-line. Take this into account when examining
  518. input that was piped in by the echo command.
  519.