#!/bin/sh # # This is my patch _01 to perl5.003. # # This patch contains the last few months' worth of bugfixes and # additions, since the patch to version 5.003 was deliberately kept # small. A summary of major revisions and additions can be found # in the diff of the Changes file from the standard distribution, # which is the first diff in the patch below. # # The detailed changes to each file are described at the head of the diff # for that file, on lines beginning with #~, so you can extract the # comments by saying perl -ne 'print if /^(?:#~|diff)/'. # # This patch is a series of context diffs, since some people have # mentioned that their copy of patch can't handle unidiffs. # Please apply it to a clean copy of perl5.003 using patch -p1 -N. # Before applying the patch, please execute the following commands, # or their moral equivalent; you may feed this patch to /bin/sh in # order to do so. # # Enjoy. # # Charles Bailey # July 31, 1996 # The code for the Safe extension has been subsumed into the Opcode extension, # though the calling sequence hasn't changed rm -rf ext/Safe rm -f t/lib/safe.t # Removed due to copyright notice. Text documentation is supplied. rm -f ext/SDBM_File/sdbm/readme.ps # Changes subsumed into new version of DB_File rm -f os2/diff.db_file # Moved to main source directory as README.os2 rm -f os2/README exit 0 ## Start of patch ## #~ Note major changes for releases 5.002_01 through 5.003_01 diff -Pcr perl5_003/Changes perl5_003_01/Changes *** perl5_003/Changes Mon Mar 25 01:04:00 1996 --- perl5_003_01/Changes Tue Jul 30 17:03:35 1996 *************** *** 1,3 **** --- 1,280 ---- + Please note: This file provides a summary of significant changes + between versions and sub-versions of Perl, not a complete list + of each modification. If you'd like more detailed information, + please consult the comments in the patches on which the relevant + release of Perl is based. (Patches can be found on any CPAN + site, in the .../src/5.0 directory for full version releases, + or in the .../src/5/0/unsupported directory for sub-version + releases.) + + + ---------------- + Version 5.003_01 + ---------------- + + Version 5.003_01 contains bugfixes and additions accumulated since + version 5.002_01, since the patch to version 5.003 was deliberately + kept simple. In addition to numerous small bugfixes in the core, + library files, and documentation, this patch contains several + significant revisions, summarized below: + + o Visible Changes to Core Functionality + + - A port to Plan9 has been started, and changes are integrated into + the standard distribution. As of this release, the Perl core + and several common extensions are working. + + - A set of basic methods in the UNIVERSAL class have been added to + the Perl core. Since UNIVERSAL is an implicit member of every + class's @ISA, the methods can be called via any object. + + - A mandatory warning has been added for 'declarations' of lexical + variables using the "my" operator which mask an existing lexical + variable declared in the same scope, making the previous variable + inaccessible by its name. + + - The "use" and "require" operators have been extended to allow + checking of the required module's version. The "use" operator + can now be used for an immediate version check of Perl itself. + + - A new "strict" pragma, "strict untie", has been added, which + produces an error if a tied value is untied when other references + exist to the internal object implementing the tie. + + - Barewords used as associative array keys (i.e. when specifying + an associative array element like $foo{__BAR} or on the left + side of the => operator) may now begin with an underscore as + well as an alphabetic character. + + - Some of the configuration information previously produced by the + -v switch has been moved to the -V switch, in order to keep -v + output concise. + + o Changes in Core Internals + + - Symbol table and method lookups have been made faster. + + - Perl subroutines which just return a constant value are now + optimized at compile time into inline constants. + + - Management of keys for associative arrays has been improved to + conserve space when the same keys are reused frequently, and + to pass true Perl values to tie functions, instead of stringified + representations. + + - Messages normally output to stderr may be directed to another + stream when Perl is built. This allows some platforms to + present diagnostic output in a separate window from normal + program results. + + - A bug which caused suiperl to fail silently, albeit securely, + in version 5.003 on some systems has been fixed. + + - Management of Unix-style signal handlers via the %SIG associative + array has been made safer. + + - Several global C symbols have been renamed to eliminate collisions + with system C header files or libraries on some platforms. + Unfortunately, this means that dynamic extensions compiled under + previous versions of Perl will need to be rebuilt for Perl + 5.003_01. We're in the process of cleaning up Perl's C + namespace to make it easier to link Perl with other binaries, + so this will probably happen again between now and version 5.004. + After that, we'll do our best to maintain binary compatibility + between versions. + + - An alternate allocation strategy has been added to Perl's + optional private memory management routines. This strategy, + which may be selected when Perl is built, is designed to + conserve memory in programs which allocate many small + chunks of memory with sizes near a power of 2, as is often + the case in Perl programs. + + - Several memory leaks in the creation and destruction of + multiple interpreters have been fixed. + + o Changes in the Standard Library and Utilities + + - The Opcode extension, which allows you to control a program's + access to Perl operations, has been added to the standard + distribution. This extends the work begun in the original + Safe extension, and subsumes it. The Safe interface is still + available. + + - The IO extension, which provides a set of classes for object- + oriented handling of common I/O tasks, has been added to the + standard distribution. The IO classes will form the basis + for future development of Perl's I/O interface, and will + subsume the FileHandle class in the near future. The default + class to which all Perl I/O handles belong is now IO::Handle, + rather than FileHandle. + + - The ExtUtils::Embed library module, which provides a set + of utility function to help in embedding Perl in other + applications, has been added to the standard distribution. + + - The Fatal library module, which provides a simple interface + for creating "do-or-die" equivalents of existing functions, + has been added to the standard distribution. + + - The FindBin library module, which determines the full path + to the currently executing program, has been added to the + standard distribution. + + - The DB_File extension, and the Getopt::Long, Test::Harness, + Text::Tabs, Text::Wrap, Time::Local and sigtrap library modules + have been updated to the authors' latest versions. + + - The Carp library module now considers the @ISA chain when + determining the caller's package for inclusion in error messages. + + - The h2xs, perlbug, and xsubpp utilities have been updated. + + - The standard Perl debugger has been updated, and the information + provided to the debugger when an XSUB is called has been improved, + making it possible for alternate debuggers (such as Devel::DProf) + to do a better job of tracking XSUB calls. + + - The pod documentation formatting tools in the standard distribution + can now handle characters in the input stream whose high bit is set. + + - The cperl-mode EMACS editing mode has been updated. + + o Changes in Documentation + + - Typographic and formatting errors have been corrected in the pod + documentation for the core and standard library files + + - Explanations of several core operators have been improved + + - The perldebug, perlembed, perlipc, perlsec, and perltrap documents + extensively revised. + + o Changes in OS-specific and Build-time Support + + - Support for the NeXT platform has been extended through + NeXTSTEP/OPENSTEP 4.0, and now includes the ability to create MABs. + + - Support for OS/2 has been extended as well, and now includes + options for building a.out binaries. + + - Support for VMS has also been extended, incorporating improved + processing of file specification strings, optional suppression of + carriage control interpretation for record-structured files, + improved support for the -S command line switch, a number of + VMS-specific bugfixes, and significantly improved performance + in line-oriented reading of files. + + - Several hints files have been added or updated: aux.sh (updated), + convexos.sh (updated), irix_4.sh (updated), irix_5.sh (updated), + irix_6_2.sh (updated), next_3.sh (updated), next_3_2.sh (new), + next_3_3.sh (new), next_4.sh (new), os2/sh (updated), + sco.sh (updated), and solaris_2.sh (updated). + + - The test driver for the regression tests now reports when a set + of tests have been skipped (presumable because the operation + they're designed to test isn't supported on the current system). + + ------------- + Version 5.003 + ------------- + + ***> IMPORTANT NOTICE: <*** + The main reason for this release was to fix a security bug affecting + suidperl on some systems. If you build suidperl on your system, it + is strongly recommended that you replace any existing copies with + version 5.003 or later immediately. + + The changes in 5.003 have been held to a minimum, in the hope that this + will simplify installation and testing at sites which may be affected + by the security hole in suidperl. In brief, 5.003 does the following: + + - Plugs security hole in suidperl mechanism on affected systems + + - MakeMaker was also updated to version 5.34, and extension Makefile.PLs + were modified to match it. + + - The following hints files were updated: bsdos.sh, hpux.sh, linux.sh, + machten.sh, solaris_2.sh + + - A fix was added to installperl to insure that file permissions were + set correctly for the installed C header files. + + - t/op/stat.t was modified to work around MachTen's belief that /dev/null + is a terminal device. + + - Incorporation of Perl version information into the VMS' version of + config.h was changed to make it compatible with the older VAXC. + + - Minor fixes were made to VMS-specific C code, and the routine + VMS::Filespec::rmsexpand was added. + + ---------------- + Version 5.002_01 + ---------------- + + - The EMBED namespace changes are now used by default, in order to better + segregate Perl's C global symbols from those belonging to embedding + applications or to libraries. This makes it necessary to rebuild dynamic + extensions built under previous versions of Perl without the EMBED option. + The default use of EMBED can be overridden by placing -DNO_EMBED on the + cc command line. + + The EMBED change is the beginning of a general cleanup of C global + symbols used by Perl, so binary compatibility with previously + compiled dynamic extensions may be broken again in the next few + releases. + + - Several bugs in the core were fixed, including the following: + - made sure FILE * for -e temp file was closed only once + - improved form of single-statement macro definitions to keep + as many ccs as possible happy + - fixed file tests to insure that signed values were used when + computing differences between times. + - fixed toke.c so implicit loop isn't doubled when perl is + invoked with both the -p and -n switches + + - The new SUBVERSION number has been included in the default value for + architecture-specific library directories, so development and + production architecture-dependent libraries can coexist. + + - Two new magic variables, $^E and $^O, have been added. $^E contains the + OS-specific equivalent of $!. $^O contains the name of the operating + system, in order to make it easily available to Perl code whose behavior + differs according to its environment. The standard library files have + been converted to use $^O in preference to $Config{'osname'}. + + - A mechanism was added to allow listing of locally applied patches + in the output of perl -v. + + - Miscellaneous minor corrections and updates were made to the documentation. + + - Extensive updates were made to the OS/2 and VMS ports + + - The following hints file were updated: bsdos.sh, dynixptx.sh, + irix_6_2.sh, linux.sh, os2.sh + + - Several changes were made to standard library files: + - reduced use of English.pm and $`, $', and $& in library modules, + since these degrade module loading and evaluation of regular expressions, + respectively. + - File/Basename.pm: Added path separator to dirname('.') + - File/Copy.pm: Added support for VMS and OS/2 system-level copy + - MakeMaker updated to v5.26 + - Symbol.pm now accepts old (') and new (::) package delimiters + - Sys/Syslog.pm uses Sys::Hostname only when necessary + - chat2.pl picks up necessary constants from socket.ph + - syslog.pl: Corrected thinko 'Socket' --> 'Syslog' + - xsubpp updated to v1.935 + + + - The perlbug utility is now more cautious about sending mail, in order + to reduce the chance of accidentally send a bug report by giving the + wrong response to a prompt. + + - The -m switch has been added to perldoc, causing it to display the + Perl code in target file as well as any documentation. + ------------- Version 5.002 ------------- #~ Added MAB support for Next #~ Correct recognition of irix 6 #~ Use C locale when obtaining Perl version for arch-dependent dir names #~ Insure that config.sh is writeable #~ Improve test for broken gconvert() #~ Set cc and ld switches properly for shared libraries under linux and irix #~ Correct dynamic loading test so that $dlext=o doesn't break it diff -Pcr perl5_003/Configure perl5_003_01/Configure *** perl5_003/Configure Mon Mar 25 01:04:01 1996 --- perl5_003_01/Configure Thu Jul 18 16:01:50 1996 *************** *** 231,236 **** --- 231,237 ---- gccversion='' ccflags='' cppflags='' + mab='' ldflags='' lkflags='' locincpth='' *************** *** 1638,1644 **** *) osvers="$3" ;; esac ;; ! irix) osname=irix case "$3" in 4*) osvers=4 ;; 5*) osvers=5 ;; --- 1639,1645 ---- *) osvers="$3" ;; esac ;; ! irix*) osname=irix case "$3" in 4*) osvers=4 ;; 5*) osvers=5 ;; *************** *** 1857,1862 **** --- 1858,1864 ---- tmp_c="$c" cd .. cp $config_sh config.sh 2>/dev/null + chmod +w config.sh . ./config.sh cd UU cp ../config.sh . *************** *** 2331,2337 **** set dflt eval $prefixup ;; ! *) version=`echo $baserev $patchlevel $subversion | \ $awk '{print $1 + $2/1000.0 + $3/100000.0}'` dflt="$privlib/$archname/$version" ;; --- 2333,2340 ---- set dflt eval $prefixup ;; ! *) version=`LC_ALL=C;export LC_ALL;\ ! echo $baserev $patchlevel $subversion | \ $awk '{print $1 + $2/1000.0 + $3/100000.0}'` dflt="$privlib/$archname/$version" ;; *************** *** 4621,4626 **** --- 4624,4633 ---- #endif main() { char buf[64]; + /* This test must come first. */ + Gconvert(0.1, 8, 0, buf); + if (buf[0] != '.' || buf[1] != '1' || buf[2] != '\0') + exit(1); Gconvert(1.0, 8, 0, buf); if (buf[0] != '1' || buf[1] != '\0') exit(1); *************** *** 5388,5393 **** --- 5395,5401 ---- hpux) dflt='+z' ;; next) dflt='none' ;; solaris|svr4*|esix*) dflt='-Kpic' ;; + irix*) dflt='-KPIC' ;; sunos) dflt='-pic' ;; *) dflt='none' ;; esac ;; *************** *** 5455,5461 **** case "$lddlflags" in '') case "$osname" in hpux) dflt='-b' ;; ! linux) dflt='-shared' ;; next) dflt='none' ;; solaris) dflt='-G' ;; sunos) dflt='-assert nodefinitions' ;; --- 5463,5469 ---- case "$lddlflags" in '') case "$osname" in hpux) dflt='-b' ;; ! linux|irix*) dflt='-shared' ;; next) dflt='none' ;; solaris) dflt='-G' ;; sunos) dflt='-assert nodefinitions' ;; *************** *** 5646,5652 **** } EOM if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 && ! $ld $lddlflags -o dyna.$dlext dyna.o > /dev/null 2>&1 && $cc $ccflags $ldflags $cccdlflags $ccdlflags fred.c -o fred $libs > /dev/null 2>&1; then xxx=`./fred` case $xxx in --- 5654,5661 ---- } EOM if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 && ! mv dyna.o tmp-dyna.o > /dev/null 2>&1 && ! $ld $lddlflags -o dyna.$dlext tmp-dyna.o > /dev/null 2>&1 && $cc $ccflags $ldflags $cccdlflags $ccdlflags fred.c -o fred $libs > /dev/null 2>&1; then xxx=`./fred` case $xxx in *************** *** 5664,5670 **** ;; esac ! $rm -f fred fred.? dyna.$dlext dyna.? set d_dlsymun eval $setvar --- 5673,5679 ---- ;; esac ! $rm -f fred fred.? dyna.$dlext dyna.? tmp-dyna.? set d_dlsymun eval $setvar *************** *** 9262,9267 **** --- 9271,9277 ---- lpr='$lpr' ls='$ls' lseektype='$lseektype' + mab='$mab' mail='$mail' mailx='$mailx' make='$make' #~ Point non-Unix users to OS-specific READMEs #~ Use correct -B values for gcc under Solaris #~ Include minor pod format fixes #~ Mention h2ph #~ Revise notes about multiple versions coexisting diff -Pcr perl5_003/INSTALL perl5_003_01/INSTALL *** perl5_003/INSTALL Mon Jun 24 16:07:53 1996 --- perl5_003_01/INSTALL Wed Jul 10 11:51:42 1996 *************** *** 18,24 **** proceeding. Special notes specific to this release are identified by B. ! =head1 BUILDING PERL5 =head1 Start with a Fresh Distribution. --- 18,31 ---- proceeding. Special notes specific to this release are identified by B. ! If you're building Perl on a non-Unix system, you should also read ! the README file specific to your operating system, since this may ! provide additional or different instructions for building Perl. ! ! =head1 DESCRIPTION ! ! The following is the procedures you need to follow in order to successfully ! build perl. =head1 Start with a Fresh Distribution. *************** *** 351,357 **** All the installation questions have been moved to the top, so you don't have to wait for them. Once you've handled them (and your C compiler & ! flags) you can type '&-d' at the next Configure prompt and Configure will use the defaults from then on. If you find yourself trying obscure command line incantations and --- 358,364 ---- All the installation questions have been moved to the top, so you don't have to wait for them. Once you've handled them (and your C compiler & ! flags) you can type C<&-d> at the next Configure prompt and Configure will use the defaults from then on. If you find yourself trying obscure command line incantations and *************** *** 539,545 **** If you have problems with dynamic loading using gcc on SunOS or Solaris, and you are using GNU as and GNU ld, you may need to add ! B<-B/bin/> (for SunOS) or B<-B/usr/ccs/bin> (for Solaris) to your $ccflags, $ldflags, and $lddlflags so that the system's versions of as and ld are used. --- 546,552 ---- If you have problems with dynamic loading using gcc on SunOS or Solaris, and you are using GNU as and GNU ld, you may need to add ! B<-B/bin/> (for SunOS) or B<-B/usr/ccs/bin/> (for Solaris) to your $ccflags, $ldflags, and $lddlflags so that the system's versions of as and ld are used. *************** *** 583,588 **** --- 590,596 ---- Look for things like: C or C. All these mean that Perl is trying to run some external program. + =head1 INSTALLING PERL5 =head1 make install *************** *** 662,673 **** to generate the LaTeX versions. =head1 Coexistence with earlier versions of perl5. ! You can safely install the current version of perl5 and still run ! scripts under the old binaries. Instead of starting your script with ! #!/usr/local/bin/perl, just start it with #!/usr/local/bin/perl5.001 ! (or whatever version you want to run.) The architecture-dependent files are stored in a version-specific directory (such as F) so that --- 670,701 ---- to generate the LaTeX versions. + =head1 cd /usr/include; h2ph *.h sys/*.h + + Some of the perl library files need to be able to obtain information from + the system header files. This command will convert the most commonly used + header files in F into files that can be easily interpreted + by perl. These files will be placed in architectural library directory + you specified to B; by default this is + F, where B is your architecture + (such as C) and B is the version of perl you are + building (for example, C<5.003>). + + B Due to differences in the C and perl languages, the conversion of + the header files in not perfect. You may have to hand edit some of the + converted files to get them to parse correctly. For example, it breaks + spectacularly on type casting and certain structures. + =head1 Coexistence with earlier versions of perl5. ! You can safely install the current version of perl5 and still run scripts ! under the old binaries for versions 5.002 and later ONLY. Instead of ! starting your script with #!/usr/local/bin/perl, just start it with ! #!/usr/local/bin/perl5.001 (or whatever version you want to run.) ! If you want to retain a version of perl5 prior to perl5.002, you'll ! need to install the current version in a separate directory tree, ! since some of the architecture-independent library files have changed ! in incompatible ways. The architecture-dependent files are stored in a version-specific directory (such as F) so that *************** *** 678,684 **** files. The standard library files in F ! should be useable by all versions of perl5. Most extensions will probably not need to be recompiled to use with a newer version of perl. If you do run into problems, and you want to continue --- 706,712 ---- files. The standard library files in F ! should be useable by all versions of perl5 since perl5.002. Most extensions will probably not need to be recompiled to use with a newer version of perl. If you do run into problems, and you want to continue *************** *** 740,743 **** =head1 LAST MODIFIED ! 19 March 1996 --- 768,771 ---- =head1 LAST MODIFIED ! 07 July 1996 #~ Update to reflect current contents of kit diff -Pcr perl5_003/MANIFEST perl5_003_01/MANIFEST *** perl5_003/MANIFEST Mon Mar 25 01:04:56 1996 --- perl5_003_01/MANIFEST Mon Jul 29 19:41:20 1996 *************** *** 10,16 **** MANIFEST This list of files Makefile.SH A script that generates Makefile README The Instructions ! README.vms Notes about VMS Todo The Wishlist XSUB.h Include file for extension subroutines av.c Array value code --- 10,18 ---- MANIFEST This list of files Makefile.SH A script that generates Makefile README The Instructions ! README.os2 Notes about OS/2 port ! README.plan9 Notes about Plan9 port ! README.vms Notes about VMS port Todo The Wishlist XSUB.h Include file for extension subroutines av.c Array value code *************** *** 87,93 **** ext/DynaLoader/dl_hpux.xs HP-UX implementation ext/DynaLoader/dl_next.xs Next implementation ext/DynaLoader/dl_none.xs Stub implementation ! ext/DynaLoader/dl_os2.xs OS/2 implementation ext/DynaLoader/dl_vms.xs VMS implementation ext/DynaLoader/dlutils.c Dynamic loader utilities for dl_*.xs files ext/Fcntl/Fcntl.pm Fcntl extension Perl module --- 89,95 ---- ext/DynaLoader/dl_hpux.xs HP-UX implementation ext/DynaLoader/dl_next.xs Next implementation ext/DynaLoader/dl_none.xs Stub implementation ! ext/DynaLoader/dl_os2.xs OS/2 (non-a.out) implementation ext/DynaLoader/dl_vms.xs VMS implementation ext/DynaLoader/dlutils.c Dynamic loader utilities for dl_*.xs files ext/Fcntl/Fcntl.pm Fcntl extension Perl module *************** *** 100,105 **** --- 102,116 ---- ext/GDBM_File/GDBM_File.xs GDBM extension external subroutines ext/GDBM_File/Makefile.PL GDBM extension makefile writer ext/GDBM_File/typemap GDBM extension interface types + ext/IO/IO.pm Top-level interface to IO::* classes + ext/IO/IO.xs IO extension external subroutines + ext/IO/Makefile.PL IO extension makefile writer + ext/IO/lib/IO/File.pm IO::File extension Perl module + ext/IO/lib/IO/Handle.pm IO::Handle extension Perl module + ext/IO/lib/IO/Pipe.pm IO::Pipe extension Perl module + ext/IO/lib/IO/Seekable.pm IO::Seekable extension Perl module + ext/IO/lib/IO/Select.pm IO::Select extension Perl module + ext/IO/lib/IO/Socket.pm IO::Socket extension Perl module ext/NDBM_File/Makefile.PL NDBM extension makefile writer ext/NDBM_File/NDBM_File.pm NDBM extension Perl module ext/NDBM_File/NDBM_File.xs NDBM extension external subroutines *************** *** 114,119 **** --- 125,135 ---- ext/ODBM_File/hints/solaris.pl Hint for ODBM_File for named architecture ext/ODBM_File/hints/svr4.pl Hint for ODBM_File for named architecture ext/ODBM_File/typemap ODBM extension interface types + ext/Opcode/Opcode.pm Opcode extension Perl module + ext/Opcode/Opcode.xs Opcode extension external subroutines + ext/Opcode/Safe.pm Safe extension Perl module + ext/Opcode/ops.pm "Pragma" form of Opcode extension Perl module + ext/Opcode/Makefile.PL Opcode extension makefile writer ext/POSIX/Makefile.PL POSIX extension makefile writer ext/POSIX/POSIX.pm POSIX extension Perl module ext/POSIX/POSIX.pod POSIX extension documentation *************** *** 142,157 **** ext/SDBM_File/sdbm/pair.c SDBM kit ext/SDBM_File/sdbm/pair.h SDBM kit ext/SDBM_File/sdbm/readme.ms SDBM kit - ext/SDBM_File/sdbm/readme.ps SDBM kit ext/SDBM_File/sdbm/sdbm.3 SDBM kit ext/SDBM_File/sdbm/sdbm.c SDBM kit ext/SDBM_File/sdbm/sdbm.h SDBM kit ext/SDBM_File/sdbm/tune.h SDBM kit ext/SDBM_File/sdbm/util.c SDBM kit ext/SDBM_File/typemap SDBM extension interface types - ext/Safe/Makefile.PL Safe extension makefile writer - ext/Safe/Safe.pm Safe extension Perl module - ext/Safe/Safe.xs Safe extension external subroutines ext/Socket/Makefile.PL Socket extension makefile writer ext/Socket/Socket.pm Socket extension Perl module ext/Socket/Socket.xs Socket extension external subroutines --- 158,169 ---- *************** *** 215,220 **** --- 227,235 ---- hints/netbsd.sh Hints for named architecture hints/next_3.sh Hints for named architecture hints/next_3_0.sh Hints for named architecture + hints/next_3_2.sh Hints for named architecture + hints/next_3_3.sh Hints for named architecture + hints/next_4.sh Hints for named architecture hints/opus.sh Hints for named architecture hints/os2.sh Hints for named architecture hints/powerux.sh Hints for named architecture *************** *** 254,259 **** --- 269,275 ---- lib/English.pm Readable aliases for short variables lib/Env.pm Map environment into ordinary variables lib/Exporter.pm Exporter base class + lib/ExtUtils/Embed.pm Utilities for embedding Perl in C programs lib/ExtUtils/Install.pm Handles 'make install' on extensions lib/ExtUtils/Liblist.pm Locates libraries lib/ExtUtils/MM_OS2.pm MakeMaker methods for OS/2 *************** *** 266,277 **** --- 282,295 ---- lib/ExtUtils/testlib.pm Fixes up @INC to use just-built extension lib/ExtUtils/typemap Extension interface types lib/ExtUtils/xsubpp External subroutine preprocessor + lib/Fatal.pm Make do-or-die equivalents of functions lib/File/Basename.pm A module to emulate the basename program lib/File/CheckTree.pm Perl module supporting wholesale file mode validation lib/File/Copy.pm Emulation of cp command lib/File/Find.pm Routines to do a find lib/File/Path.pm A module to do things like `mkdir -p' and `rm -r' lib/FileCache.pm Keep more files open than the system permits + lib/FindBin.pm Find name of currently executing program lib/Getopt/Long.pm A module to fetch command options (GetOptions) lib/Getopt/Std.pm A module to fetch command options (getopt, getopts) lib/I18N/Collate.pm Routines to do strxfrm-based collation *************** *** 364,373 **** opcode.h Automatically generated opcode header opcode.pl Opcode header generatore os2/diff.configure Patches to Configure ! os2/diff.db_file patch to DB_File os2/Makefile.SHs Shared library generation for OS/2 os2/POSIX.mkfifo POSIX.xs patch. - os2/README OS/2 port info. os2/README.old previous OS/2 port info, partially relevant. os2/notes Notes for perl maintainer os2/os2.c Additional code for OS/2 --- 382,391 ---- opcode.h Automatically generated opcode header opcode.pl Opcode header generatore os2/diff.configure Patches to Configure ! os2/dl_os2.c Addon for dl_open ! os2/dlfcn.h Addon for dl_open os2/Makefile.SHs Shared library generation for OS/2 os2/POSIX.mkfifo POSIX.xs patch. os2/README.old previous OS/2 port info, partially relevant. os2/notes Notes for perl maintainer os2/os2.c Additional code for OS/2 *************** *** 383,388 **** --- 401,420 ---- perly.fixer A program to remove yacc stack limitations perly.h The header file for perly.c perly.y Yacc grammar for perl + plan9/aperl Shell to make Perl error messages Acme-friendly + plan9/arpa/inet.h Plan9 port: replacement C header file + plan9/buildinfo Plan9 port: configuration information + plan9/config.plan9 Plan9 port: config.h template + plan9/exclude Plan9 port: tests to skip + plan9/fndvers Plan9 port: update Perl version in config.plan9 + plan9/genconfig.pl Plan9 port: generate config.sh + plan9/mkfile Plan9 port: Mk driver for build + plan9/myconfig.plan9 Plan9 port: script to print config summary + plan9/perlplan9.doc Plan9 port: Plan9-specific formatted documentation + plan9/perlplan9.pod Plan9 port: Plan9-specific pod documentation + plan9/plan9.c Plan9 port: Plan9-specific C routines + plan9/plan9ish.h Plan9 port: Plan9-specific C header file + plan9/setup.rc Plan9 port: script for easy build+install pod/Makefile Make pods into something else pod/buildtoc generate perltoc.pod pod/perl.pod Top level perl man page *************** *** 477,487 **** t/lib/dirhand.t See if DirHandle works t/lib/english.t See if English works t/lib/filehand.t See if FileHandle works t/lib/gdbm.t See if GDBM_File works t/lib/ndbm.t See if NDBM_File works t/lib/odbm.t See if ODBM_File works t/lib/posix.t See if POSIX works ! t/lib/safe.t See if Safe works t/lib/sdbm.t See if SDBM_File works t/lib/socket.t See if Socket works t/lib/soundex.t See if Soundex works --- 509,528 ---- t/lib/dirhand.t See if DirHandle works t/lib/english.t See if English works t/lib/filehand.t See if FileHandle works + t/lib/io_dup.t See if dup()-related methods from IO work + t/lib/io_pipe.t See if pipe()-related methods from IO work + t/lib/io_sock.t See if INET socket-related methods from IO work + t/lib/io_tell.t See if seek()/tell()-related methods from IO work + t/lib/io_udp.t See if UDP socket-related methods from IO work + t/lib/io_xs.t See if XSUB methods from IO work t/lib/gdbm.t See if GDBM_File works t/lib/ndbm.t See if NDBM_File works t/lib/odbm.t See if ODBM_File works + t/lib/opcode.t See if Opcode works + t/lib/ops.t See if Opcode works t/lib/posix.t See if POSIX works ! t/lib/safe1.t See if Safe works ! t/lib/safe2.t See if Safe works t/lib/sdbm.t See if SDBM_File works t/lib/socket.t See if Socket works t/lib/soundex.t See if Soundex works *************** *** 533,538 **** --- 574,580 ---- t/op/study.t See if study works t/op/subst.t See if substitution works t/op/substr.t See if substr works + t/op/tie.t See if tie/untie functions work t/op/time.t See if time functions work t/op/undef.t See if undef works t/op/unshift.t See if unshift works *************** *** 541,546 **** --- 583,589 ---- t/re_tests Regular expressions for regexp.t taint.c Tainting code toke.c The tokener + universal.c The default UNIVERSAL package methods unixish.h Defines that are assumed on Unix util.c Utility routines util.h Public declarations for the above *************** *** 560,565 **** --- 603,609 ---- vms/ext/Stdio/Stdio.pm VMS options to stdio routines vms/ext/Stdio/Stdio.xs VMS options to stdio routines vms/ext/Stdio/test.pl regression tests for VMS::Stdio + vms/ext/filespec.t See if VMS::Filespec funtions work vms/fndvers.com parse Perl version from patchlevel.h vms/gen_shrfls.pl generate options files and glue for shareable image vms/genconfig.pl retcon config.sh from config.h #~ Set shared library version number correctly on NeXT #~ Updates to OS/2 support #~ Correct typo in perl.exp #~ Add universal.c #~ Add configpm dependency to Config.pm #~ Remove chmod from test target -- last modification of source tree diff -Pcr perl5_003/Makefile.SH perl5_003_01/Makefile.SH *** perl5_003/Makefile.SH Mon Mar 25 01:04:55 1996 --- perl5_003_01/Makefile.SH Thu Jul 11 12:28:50 1996 *************** *** 25,43 **** shrpenv="" case "$d_shrplib" in *define*) patchlevel=`egrep '^#define[ ]+PATCHLEVEL' patchlevel.h \ | awk '{print $3}'` ! case "$patchlevel" in ! *[0-9]) plibsuf=.$so.$patchlevel;; ! *) plibsuf=.$so;; ! esac ! if test "x$plibext" != "x" ; then plibsuf=$plibext d_shrplib=custom ; fi ! case "$shrpdir" in ! /usr/lib) ;; ! "") ;; ! *) shrpenv="env LD_RUN_PATH=$shrpdir";; ! esac ! pldlflags="$cccdlflags";; *) plibsuf=$lib_ext pldlflags="";; esac --- 25,49 ---- shrpenv="" case "$d_shrplib" in *define*) + pldlflags="$cccdlflags" patchlevel=`egrep '^#define[ ]+PATCHLEVEL' patchlevel.h \ | awk '{print $3}'` ! if test -z "$isnext_4" ! then ! case "$patchlevel" in ! *[0-9]) plibsuf=.$so.$patchlevel;; ! *) plibsuf=.$so;; ! esac ! case "$shrpdir" in ! /usr/lib) ;; ! "") ;; ! *) shrpenv="env LD_RUN_PATH=$shrpdir";; ! esac ! else ! # NeXT uses $patchlevel to set the current version of the dynamic ! # library produced later. And the Major release number in the name ! plibsuf=.5.$so ! fi;; *) plibsuf=$lib_ext pldlflags="";; esac *************** *** 51,80 **** done static_list=' ' - static_ai_list=' ' for f in $static_ext; do base=`echo "$f" | sed 's/.*\///'` static_list="$static_list lib/auto/$f/$base\$(LIB_EXT)" - if test -f ext/$f/AutoInit.c; then - static_ai_list="$static_ai_list ext/$f/AutoInit.c" - fi - if test -f ext/$f/AutoInit.pl; then - static_ai_list="$static_ai_list ext/$f/AutoInit.pl" - fi done echo "Extracting Makefile (with variable substitutions)" ! $spitshell >Makefile <<'!NO!SUBS!' # Makefile.SH # This file is derived from Makefile.SH. Any changes made here will # be lost the next time you run Configure. ! # Makefile is used to generate makefile. The only difference ! # is that makefile has the dependencies filled in at the end. # # - !NO!SUBS! - - $spitshell >>Makefile <Makefile < tmp sh mv-if-diff tmp perlmain.c perlmain$(OBJ_EXT): perlmain.c ! $(CCCMD) $(PLDLFLAGS) $*.c # The file ext.libs is a list of libraries that must be linked in # for static extensions, e.g. -lm -lgdbm, etc. The individual --- 231,248 ---- # The Module used here must not depend on Config or any extensions. miniperl: $& miniperlmain$(OBJ_EXT) $(perllib) ! $(CC) $(LARGE) $(MAB) $(CLDFLAGS) -o miniperl miniperlmain$(OBJ_EXT) $(perllib) $(libs) @./miniperl -w -Ilib -MExporter -e 0 || $(MAKE) minitest miniperlmain$(OBJ_EXT): miniperlmain.c ! $(CCCMD) $(MAB) $(PLDLFLAGS) $*.c ! perlmain.c: miniperlmain.c config.sh $(FIRSTMAKEFILE) sh writemain $(DYNALOADER) $(static_ext) > tmp sh mv-if-diff tmp perlmain.c perlmain$(OBJ_EXT): perlmain.c ! $(CCCMD) $(MAB) $(PLDLFLAGS) $*.c # The file ext.libs is a list of libraries that must be linked in # for static extensions, e.g. -lm -lgdbm, etc. The individual *************** *** 252,273 **** -@test -f ext.libs || touch ext.libs perl: $& perlmain$(OBJ_EXT) $(perllib) $(DYNALOADER) $(static_ext) ext.libs ! $(SHRPENV) $(CC) $(LARGE) $(CLDFLAGS) $(CCDLFLAGS) -o perl perlmain$(OBJ_EXT) $(perllib) $(DYNALOADER) $(static_ext) `cat ext.libs` $(libs) pureperl: $& perlmain$(OBJ_EXT) $(perllib) $(DYNALOADER) $(static_ext) ext.libs ! purify $(CC) $(LARGE) $(CLDFLAGS) $(CCDLFLAGS) -o pureperl perlmain$(OBJ_EXT) $(perllib) $(DYNALOADER) $(static_ext) `cat ext.libs` $(libs) quantperl: $& perlmain$(OBJ_EXT) $(perllib) $(DYNALOADER) $(static_ext) ext.libs ! quantify $(CC) $(LARGE) $(CLDFLAGS) $(CCDLFLAGS) -o quantperl perlmain$(OBJ_EXT) $(perllib) $(DYNALOADER) $(static_ext) `cat ext.libs` $(libs) $(perllib): $& perl$(OBJ_EXT) $(obj) !NO!SUBS! case "$d_shrplib" in *define*) $spitshell >>Makefile <<'!NO!SUBS!' $(LD) $(LDDLFLAGS) -o $@ perl$(OBJ_EXT) $(obj) !NO!SUBS! ;; custom) if test -r $osname/Makefile.SHs ; then --- 251,285 ---- -@test -f ext.libs || touch ext.libs perl: $& perlmain$(OBJ_EXT) $(perllib) $(DYNALOADER) $(static_ext) ext.libs ! $(SHRPENV) $(CC) $(LARGE) $(MAB) $(CLDFLAGS) $(CCDLFLAGS) -o perl perlmain$(OBJ_EXT) $(perllib) $(DYNALOADER) $(static_ext) `cat ext.libs` $(libs) pureperl: $& perlmain$(OBJ_EXT) $(perllib) $(DYNALOADER) $(static_ext) ext.libs ! purify $(CC) $(LARGE) $(MAB) $(CLDFLAGS) $(CCDLFLAGS) -o pureperl perlmain$(OBJ_EXT) $(perllib) $(DYNALOADER) $(static_ext) `cat ext.libs` $(libs) quantperl: $& perlmain$(OBJ_EXT) $(perllib) $(DYNALOADER) $(static_ext) ext.libs ! quantify $(CC) $(LARGE) $(MAB) $(CLDFLAGS) $(CCDLFLAGS) -o quantperl perlmain$(OBJ_EXT) $(perllib) $(DYNALOADER) $(static_ext) `cat ext.libs` $(libs) $(perllib): $& perl$(OBJ_EXT) $(obj) !NO!SUBS! case "$d_shrplib" in *define*) + if test -z "$isnext_4" + then $spitshell >>Makefile <<'!NO!SUBS!' $(LD) $(LDDLFLAGS) -o $@ perl$(OBJ_EXT) $(obj) !NO!SUBS! + else + $spitshell >>Makefile <>Makefile <<'!NO!SUBS!' + libtool -dynamic -undefined warning -framework System \ + -compatibility_version 1 -current_version $$version \ + -prebind -seg1addr 0x27000000 -install_name $(shrpdir)/$@ \ + -o $@ perl.o $(obj) + !NO!SUBS! + fi ;; custom) if test -r $osname/Makefile.SHs ; then *************** *** 282,292 **** --- 294,311 ---- fi ;; *) + if test -z "$isnext_4" + then $spitshell >>Makefile <<'!NO!SUBS!' rm -f $(perllib) $(AR) rcu $(perllib) perl$(OBJ_EXT) $(obj) @$(ranlib) $(perllib) !NO!SUBS! + else + $spitshell >>Makefile <<'!NO!SUBS!' + libtool -static -o $(perllib) perl.o $(obj) + !NO!SUBS! + fi ;; esac *************** *** 298,309 **** # has been invoked correctly. suidperl: $& sperl$(OBJ_EXT) perlmain$(OBJ_EXT) $(perllib) $(DYNALOADER) $(static_ext) ext.libs ! $(CC) $(LARGE) $(CLDFLAGS) $(CCDLFLAGS) -o suidperl perlmain$(OBJ_EXT) sperl$(OBJ_EXT) $(perllib) $(DYNALOADER) $(static_ext) `cat ext.libs` $(libs) sperl$(OBJ_EXT): perl.c perly.h patchlevel.h $(h) $(RMS) sperl.c $(LNS) perl.c sperl.c ! $(CCCMD) -DIAMSUID sperl.c $(RMS) sperl.c # We have to call our ./makedir because Ultrix 4.3 make can't handle the line --- 317,328 ---- # has been invoked correctly. suidperl: $& sperl$(OBJ_EXT) perlmain$(OBJ_EXT) $(perllib) $(DYNALOADER) $(static_ext) ext.libs ! $(CC) $(LARGE) $(MAB) $(CLDFLAGS) $(CCDLFLAGS) -o suidperl perlmain$(OBJ_EXT) sperl$(OBJ_EXT) $(perllib) $(DYNALOADER) $(static_ext) `cat ext.libs` $(libs) sperl$(OBJ_EXT): perl.c perly.h patchlevel.h $(h) $(RMS) sperl.c $(LNS) perl.c sperl.c ! $(CCCMD) $(MAB) -DIAMSUID sperl.c $(RMS) sperl.c # We have to call our ./makedir because Ultrix 4.3 make can't handle the line *************** *** 316,322 **** autosplit_lib_modules(@ARGV)' lib/*.pm lib/*/*.pm # Take care to avoid modifying lib/Config.pm without reason ! lib/Config.pm: config.sh miniperl ./miniperl configpm tmp sh mv-if-diff tmp lib/Config.pm --- 335,341 ---- autosplit_lib_modules(@ARGV)' lib/*.pm lib/*/*.pm # Take care to avoid modifying lib/Config.pm without reason ! lib/Config.pm: config.sh miniperl configpm ./miniperl configpm tmp sh mv-if-diff tmp lib/Config.pm *************** *** 349,354 **** --- 368,374 ---- @ echo 'Expect' 130 shift/reduce and 1 reduce/reduce conflict $(BYACC) -d perly.y sh $(shellflags) ./perly.fixer y.tab.c perly.c + sed -e s/stderr/Perl_debug_log/g perly.c >perly.tmp && mv perly.tmp perly.c mv y.tab.h perly.h echo 'extern YYSTYPE yylval;' >>perly.h - perl vms/vms_yfix.pl perly.c perly.h vms/perly_c.vms vms/perly_h.vms *************** *** 445,451 **** $(MAKE) depend MAKEDEPEND= config.h: config.sh ! /bin/sh config_h.SH # When done, touch perlmain.c so that it doesn't get remade each time. depend: makedepend --- 465,474 ---- $(MAKE) depend MAKEDEPEND= config.h: config.sh ! $(SHELL) config_h.SH ! ! perl.exp: perl_exp.SH config.sh ! $(SHELL) perl_exp.SH # When done, touch perlmain.c so that it doesn't get remade each time. depend: makedepend *************** *** 458,468 **** sh ./makedepend.SH test: miniperl perl preplibrary $(dynamic_ext) - - cd t && chmod +x TEST */*.t - cd t && (rm -f perl$(EXE_EXT); $(LNS) ../perl$(EXE_EXT) perl$(EXE_EXT)) && ./perl TEST + + ======================================================== + + Notes on the patch: + ~~~~~~~~~~~~~~~~~~~ + patches should be applied as + patch -p0 <..... + All the diff.* files and POSIX.mkfifo should be applied. + + Additional files are available on + ftp://ftp.math.ohio-state.edu/pub/users/ilya/os2 + including patched pdksh and gnumake, needed for build. + + + Target: + ~~~~~~~ + + This is not supposed to make a perfect Perl on OS/2. This patch is + concerned only with perfect _build_ of Perl on OS/2. Some good + features from Andreas Kaiser port missed this port. However, most of + the features are available in different form. + + !!! Note that [gs]etpriority functions in this port are compatible + !!! with *nix, not with ak's port!!! + + The priorities are absolute, go from 32 to -95, lower is quickier. 0 + is default, + + Notes on build on OS/2: + ~~~~~~~~~~~~~~~~~~~~~~~ + The change of C code in this patch is based on the ak port of 5.001+. + + a) Make sure your sort is not the broken OS/2 one, and that you have /tmp + on the build partition. + + b) when extracting perl5.*.tar.gz you need to extract perl5.*/Configure + separately, since by default perl5.001m/configure may overwrite it; + like this: + tar vzxf perl5.004.tar.gz --case-sensitive perl5.004/Configure + + c) Necessary manual intervention when compiling on OS/2: + + Need to put perl.dll on LIBPATH after it is created. + + d) Compile summary: + ~~~~~~~~~~~~~~~ + !!! At the end of this README is independent description of the build + !!! process by Rocco Caputo. + + # Look for hints/os2.sh and correct what is different on your system + # I have rather spartan configuration. + + # Prefix means where to install: + sh Configure -des -D prefix=f:/perl5.005 + # Ignore the message about missing `ln', and about `c' option + # to tr. + make + # Will probably die after build of miniperl (unless you have DLL + # from previous compile). Need to move DLL where it belongs + # + # Somehow with 5.002b3 I needed to type another make after pod2man + make + # some warnings in POSIX.c + make test + # some tests fail, 9 or 10 on my system (see the list at end). + # + # before this you should create subdirs bin and lib in the + # prefix directory (f:/perl5.005 above): + # + # To run finer tests, cd t && perl harness + make install + + e) At the end of August GNU make and pdksh were too buggy for compile. + Both maintainers have patches that make it possible to compile perl. + The binaries are included in + ftp://ftp.math.ohio-state.edu/pub/users/ilya/os2 + patches are available too. + Note that the pdksh5.2.4 broke builds with -Zexe option because of a + changed order of executable extensions. A patch is sent to + maintainer. The version 5.2.5alpha was OK for the build, + + !!!!!!!!!!!!!!!!! + If you see that some '/' became '\' in pdksh 5.2.3, you did not apply + my patches! + Same with segfaults in Make 3.74. + !!!!!!!!!!!!!!!!! + + Problems reported: + + a) one of the latest tr is broken, get an old one :-( + 1.11 works. (On compuserver?) + b) You need a link386. + c) Get rid of invalid perl.dll on your LIBPATH. + + Note the EMX does not support en_us locale (most nobody does ;-). Some + TCP/IP update could have installed it to your config.sys. You need to + delete it until EMX is updated to support this newest discovery by IBM. + + + Send comments to ilya@math.ohio-state.edu. + + ====================================================== + Requires 0.9b (well, provision are made to make it build under 0.9a6, + but they are not tested, please inform me on success). + (earlier than 0.9b ttyname was not present, it is hard to maintain this + difference automatically, though I try). + ====================================================== + + Building with a.out style is supported by the `perl_' target of make. + Dynamic extensions are not possible with perl_.exe, since boot code + should return the retvalue on stack, the address of which is not known + to the extension. + + The reason why compiling with a.out style executables leads to problems + with dynamic extensions is: + a) OS/2 does not export symbols from executables; + b) Thus if extension needs to import symbols from an application + the symbols for the application should reside in a .dll. + c) You cannot export data from a .dll compiled with a.out style. + On the other hand, aout-style compiled extension enjoys all the + (dis)advantages of fork(). + + Check A.OUT compile with the following make targets: + + aout_test + aout_install + aout_clean + + ====================================================== + Tests which fail with OMF compile: + + io/fs.t: 2-5, 7-11, 18 as they should. + io/pipe: all, since open("|-") is not working (works with perl_.exe). + lib/"all the dbm".t: 1 test should fail (file permission). + op/fork all fail, as they should (except with perl_.exe) + op/stat 3 20 35 as they should, 39 (-t on /dev/null) ???? Sometimes 4 + - timing problem ???? + + Sometimes I have seen segfault in socket ????, only if run with Testing tools. + + A lot of `bad free'... in databases, bug in DB confirmed on other + platforms. + + Fail: Total 30 subtests (if stat:4 fails) in 10 scripts (one of 10 + is socket, which runs OK standalone). With newer configs I could not + reproduce most the crashes. + + ======================================================= + + Changes to calls to external programs: + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Due to a popular demand the perl + external program calling has been changed. _If_ perl needs to call an + external program _via shell_, the X:/bin/sh.exe will be called. The + name of the shell is not overridable, except the drive letter. + + Thus means that you need to pickup some copy of a sh.exe as well (I use one + from pdksh). The drive X: above is set up automatically during the + build, is settable in runtime from $ENV{PERL_SH_DRIVE}. + + Reasons: a consensus on perl5-porters was that perl should use one + non-overridable shell per platform. The obvious choices for OS/2 are cmd.exe + and sh.exe. Having perl build itself would be impossible with cmd.exe as + a shell, thus I picked up sh.exe. Thus assures almost 100% compatibility + with the scripts coming from *nix. + + Disadvantages: sh.exe calls external programs via fork/exec, and there is + _no_ functioning exec on OS/2. exec is emulated by EMX by asyncroneous call + while the caller waits for child completion (to pretend that pid did + not change). This means that 1 _extra_ copy of sh.exe is made active via + fork/exec, which may lead to some resources taken from the system. + + The long-term solution proposed on p5-p is to have a directive + use OS2::Cmd; + which will override system(), exec(), ``, and open(,' |'). With current + perl you may override only system(), readpipe() - the explicit version + of ``, and maybe exec(). The code will substitute a one-argument system + by CORE::system('cmd.exe', '/c', shift). + + If you have some working code for OS2::Cmd.pm, please send it to me, + I will include it into distribution. I have no need for such a module, so + cannot test it. + + =================================================== + + OS/2 extensions + ~~~~~~~~~~~~~~~ + Since binaries cannot go into perl distribution, no extensions are + included. They are available in .../os2/ilyaz directory of CPAN, as + well as in my directory + ftp://ftp.math.ohio-state.edu/pub/users/ilya/os2 + + I include 3 extensions by Andread Kaiser, OS2::REXX, OS2::UPM, and OS2::FTP, + into my ftp directory, mirrored on CPAN. I made + some minor changes needed to compile them by standard tools. I cannot + test UPM and FTP, so I will appreciate your feedback. Other extensions + there are OS2::ExtAttribs, OS2::PrfDB for tied access to EAs and .INI + files - and maybe some other extensions at the time you read it. + + Note that OS2 perl defines 2 pseudo-extension functions + OS2::Copy::copy and DynaLoader::mod2fname. + + The -R switch of older perl is deprecated. If you need to call a REXX code + which needs access to variables, include the call into a REXX compartment + created by + REXX_call {...block...}; + + Two new functions are supported by REXX code, + REXX_eval 'string'; + REXX_eval_with 'string', REXX_function_name => \&perl_sub_reference; + + If you have some other extensions you want to share, send the code to me. + Two jump to mind: tied access to EA's, and tied access to system databases. + + ================================================================== + == == + == User report [my comments in brackets, IZ] == + == == + ================================================================== + + Starting in x:/usr/src, using 4OS2/32 2.5 as the command interpreter on + OS/2 2.30 with FixPak-17. DAX is installed, but this shouldn't be a + factor. Drive X is a TVFS virtual drive pointing to several physical + HPFS drives. + + >>> Make sure that no copies or perl are currently running. Miniperl + may fail during the build because it will find an older version + of perl.dll loaded in memory. + + Close any running perl scripts. + Shut down anything that might run perl scripts, like cron. + `emxload -l` to check for loaded versions of perl. + `emxload -u perl.exe` to unload them. + + >>> Pre-load some common utilities: + + emxload -e sh.exe make.exe ls.exe tr.exe id.exe sed.exe + SET GCCLOAD=30 (number of minutes to hold the compiler) + [grep egrep fgrep cat rm uniq basename uniq sort - are not bad too.] + The theory is that it's faster to demand-load the development tools + from virtual memory than it is to re-load and re-link them all the + time. This is definitely true with my system because swapfile.dat + is on a faster drive than my development environment. + + ls, tr, and id represent the GNU file, text, and shell utilities. + These may not be needed, but it makes sure that their respective + DLLs are in memory. + + >>> Unpack the perl 5_002_01 archive onto an HPFS partition. + + tar vxzf perl5_002_01.tar-gz + cd perl5.002_01 + + [Do not forget to extract Configure as described above.] + + >>> Read the README, keeping a copy open in another session for reference. + + start /c /fg less os2/README + + >>> Apply the OS/2 patches included with 5.002_01, as per the README. + + for %m in (os2\diff.*) patch -p0 < %m + patch -p0 < os2\POSIX.mkfifo + + [The patch below is already applied.] + + >>> You may need to apply this patch if you plan to run a non-standard + Configure (that is, if you defy the README). This patch will ensure + that Makefile inherits the libraries specified during Configure. + People running standard perl builds can probably ignore this patch. + + *** os2\Makefile.SHs Mon Mar 25 02:05:00 1996 + --- os2\Makefile.SHs.new Fri May 24 10:37:10 1996 + *************** + *** 9,15 **** + emximp -o perl.imp perl5.def + + perl.dll: $(obj) perl5.def perl$(OBJ_EXT) + ! $(LD) $(LDDLFLAGS) -o $@ perl$(OBJ_EXT) $(obj) -lsocket perl5.def + + perl5.def: perl.linkexp + echo "LIBRARY 'Perl' INITINSTANCE TERMINSTANCE" > $@ + --- 9,15 ---- + emximp -o perl.imp perl5.def + + perl.dll: $(obj) perl5.def perl$(OBJ_EXT) + ! $(LD) $(LDDLFLAGS) -o $@ perl$(OBJ_EXT) $(obj) $(libs) perl5.def + + perl5.def: perl.linkexp + echo "LIBRARY 'Perl' INITINSTANCE TERMINSTANCE" > $@ + *************** + *** 49,55 **** + cat perl.exports perl.map | sort | uniq -d | sed -e 's/\w\+/ "\0"/' > perl.linkexp + + perl.map: $(obj) perl$(OBJ_EXT) miniperlmain$(OBJ_EXT) + ! $(CC) $(LARGE) $(CLDFLAGS) $(CCDLFLAGS) -o dummy.exe miniperlmain$(OBJ_EXT) perl$(OBJ_EXT) $(obj) -lsocket -lm -Zmap -Zlinker /map + awk '{if ($$3 == "") print $$2}' perl.map + rm dummy.exe dummy.map + + --- 49,55 ---- + cat perl.exports perl.map | sort | uniq -d | sed -e 's/\w\+/ "\0"/' > perl.linkexp + + perl.map: $(obj) perl$(OBJ_EXT) miniperlmain$(OBJ_EXT) + ! $(CC) $(LARGE) $(CLDFLAGS) $(CCDLFLAGS) -o dummy.exe miniperlmain$(OBJ_EXT) perl$(OBJ_EXT) $(obj) $(libs) -Zmap -Zlinker /map + awk '{if ($$3 == "") print $$2}' perl.map + rm dummy.exe dummy.map + + >>> Apply the patches from Ilya's perl5.002_01 binary distribution: + + touch os2/dlfcn.h os2/dl_os2.c + patch -p1 < f:\perllib\README.fix1 + + >>> Run Configure. Most people can run it by following the README: + + sh Configure -des -D prefix=f:/usr/local + + Advanced perl users (experienced C programmers, recommended) can run + the interactive Configure and answer the questions. When in doubt + about an answer, check the EMX headers and documentation. Pick the + default answer if that doesn't help: + + sh Configure + + [Yet more advanced users just specify the answers on the command line + of Configure, like I did with prefix.] + + Note: You may need to wrap an answer in quotes if it contains + spaces. For example, "-lsocket -lm". + + Note: If you want to add some options to a long default, you can + use $* to include the default in your answer: "$* -DDEBUGGING". + + Configure warnings and errors, and possible work-arounds: + + I don't know where 'ln' is.... + (ignored; OS/2 doesn't have a ln command) + + nm didn't seem to work right. Trying emxomfar instead... + (nothing to worry about) + + The recommended value for $d_shrplib on this machine was "define"! + (kept the recommended value: y) + + Directory f:/usr/lib/perl5/os2/5.00201/CORE doesn't exist. + (created the directory from another window with + \usr\bin\mkdir -p f:/usr/lib/perl5/os2/5.00201/CORE + and then answered: y. Your directory may look different.) + + [Ignore this as well, install script will create it for you.] + + The recommended value for $i_dlfcn on this machine was "define"! + (kept the recommended value: y) + + The recommended value for $d_fork on this machine was "undef"! + (kept the recommended value: y) + + Figuring out the flag used by open() for non-blocking I/O... + Seems like we can use O_NONBLOCK. + This seems to be used for informative purposes only. + The errors that follow this (including a SIGPIPE) don't seem + to affect perl at all. These were safely ignored. + + What pager is used on your system? [/usr/ucb/more] + Had to answer "/usr/bin/less.exe" because Configure wants a + leading / (unix full path). Need to edit config.sh later with + the real full path to the pager, including the drive letter. + + [Apparently this setting is never used, so it is safe to ignore it.] + + Hmm... F:/USR/BIN/sed: Unterminated `s' command + Perl built fine even with this error, so it seems safe to + ignore. + + Things I did different from the defaults. Most (if not all) of these + are optional changes. They're listed here to show how good Configure + is at detecting the system setup. + + [I add the options to put it on command line of Configure, see below.] + + Selected 'none' for the man1 location. + (I prefer the pod2html version.) + [-D man1dir=none] + Selected 'none' for the man3 location. + (I prefer the pod2html version.) + [-D man3dir=none] + Changed the hostname and domain. + (I wanted to override a dynamic PPP address. This only + matters if other people will be using your perl build.) + [-D myhostname=my_host_name -D mydomain=.foo.org] + Fixed the e-mail address. + (Put in a known working e-mail address. This only matters + if other people will be using your perl build.) + [-D cf_email=root@myhostname.uucp] + Added some directories to the library search path. + [-D "libpth=f:/emx/lib/st f:/emx/lib"] + Added -g to the optimizer/debugger flags. + [-D optimize=-g] + Added "-lgdbm -ldb -lcrypt -lbsd" to the additional libraries. + [ -D "libs=-lsocket -lcrypt -lgdbm" + the rest of libraries will not be used] + + >>> Advanced users may want to edit config.sh when prompted by Configure. + Most (all?) of these changes aren't really necessary: + + d_getprior='define' + d_setprior='define' + (getpriority and setpriority are included in os2.c, but + Configure doesn't know to look there.) + [fixed already] + pager='f:/usr/bin/less.exe' + (Correcting Configure's insistence on a leading slash.) + bin_sh='f:/usr/bin/sh.exe' + (If Configure detects sh.exe somewhere else first. Example: + it saw sh.exe at /bin/sh.exe on my TVFS drive, but I want + perl to look for it on the physical F drive.) + aout_ccflags='... existing flags... -DDEBUGGING' + aout_cppflags='... existing flags... -DDEBUGGING' + (If you want to include DEBUGGING for the aout version.) + [Do not do it, -D optimize=-g will automatically add these flags.] + + >>> Allow Configure to make the build scripts. + + >>> Allow Configure to run `make depend`. Ignore the following warning: + + perl.h:861: warning: `DEBUGGING_MSTATS' redefined + [corrected now] + + >>> Rename any existing perl.dll, preventing anything from loading it and + saving a known working copy in case something goes wrong: + + mv /usr/lib/perl.dll /usr/lib/ilya-perl.dll + + >>> Run `make`, and ignore the following warnings: + + perl.h:861: warning: `DEBUGGING_MSTATS' redefined + [corrected now] + invalid preprocessing directive name + emxomf warning: Cycle detected by make_type + LINK386 : warning L4071: application type not specified; assuming WINDOWCOMPAT + Warning (will try anyway): No library found for -lposix + Warning (will try anyway): No library found for -lcposix + POSIX.c:203: warning: `mkfifo' redefined + POSIX.c:4603: warning: assignment makes pointer from integer without a cast + + >>> If `make` dies while "Making DynaLoader (static)", you'll need to + put miniperl in the OS/2 paths. This step is only necessary if `make` + can't find miniperl: + [I would be interested if somebody confirmes this.] + + cp perl.dll /usr/lib (where /usr/lib is in your LIBPATH) + cp miniperl.exe /usr/bin (where /usr/bin is in your PATH) + make (ignore the errors in the previous step) + + This should run to completion. + + >>> Test the build: + + make test + + These tests fail: + + io/fs..........FAILED on test 2 + + "OS/2 is not unix". Test 2 checks the link() command, which + is not supported by OS/2. + + io/pipe........f:/usr/bin/sh.exe: -c requires an argument + f:/usr/bin/sh.exe: -c requires an argument + The Unsupported function fork function is unimplemented at + io/pipe.t line 26. + FAILED on test 1 + + More "OS/2 is not unix" errors. Read ahead to find out + why fork() fails. + + op/exec........FAILED on test 4 + + if (system "true") {print "not ok 4\n";} else \ + {print "ok 4\n";} + + This fails for me, but changing it to read like this works: + + if (system '\usr\bin\true.cmd') {print "not ok 4\n";} \ + else {print "ok 4\n";} + + So you can count this as another "OS/2 is not unix". + + op/fork........The Unsupported function fork function is \ + unimplemented at op/fork.t line 8. + FAILED on test 1 + + The dynamically-loaded version of perl currently doesn't + support fork(). This is a known behavior of EMX. + + op/magic....... + Process terminated by SIGINT + ok + + The test passed even with the SIGINT message. I don't + know why, but I won't argue. + + op/stat........ls: /dev: No such file or directory + f:/usr/bin/sh.exe: ln: not found + ls: perl: No such file or directory + FAILED on test 3 + + "OS/2 is not unix". We don't have the ln command. + + lib/anydbm.....Bad free() ignored at lib/anydbm.t line 51. + Bad free() ignored at lib/anydbm.t line 51. + Bad free() ignored at lib/anydbm.t line 51. + Bad free() ignored during global destruction. + Bad free() ignored during global destruction. + Bad free() ignored during global destruction. + FAILED on test 2 + + Test 2 looks at the file permissions for a database. "OS/2 + is not unix" so the permissions aren't exactly what this test + expects. + + lib/db-btree...Bad free() ignored at lib/db-btree.t line 109. + Bad free() ignored at lib/db-btree.t line 221. + Bad free() ignored at lib/db-btree.t line 337. + Bad free() ignored at lib/db-btree.t line 349. + Bad free() ignored at lib/db-btree.t line 349. + Bad free() ignored at lib/db-btree.t line 399. + Bad free() ignored at lib/db-btree.t line 400. + Bad free() ignored at lib/db-btree.t line 401. + FAILED on test 20 + + Another file permissions test fails. + + lib/db-hash....Bad free() ignored at lib/db-hash.t line 101. + Bad free() ignored at lib/db-hash.t line 101. + Bad free() ignored at lib/db-hash.t line 101. + Bad free() ignored at lib/db-hash.t line 239. + Bad free() ignored at lib/db-hash.t line 239. + Bad free() ignored at lib/db-hash.t line 239. + Bad free() ignored at lib/db-hash.t line 253. + Bad free() ignored at lib/db-hash.t line 253. + Bad free() ignored at lib/db-hash.t line 253. + FAILED on test 16 + + Another file permissions test fails. + + lib/db-recno...Bad free() ignored at lib/db-recno.t line 138. + Bad free() ignored at lib/db-recno.t line 138. + FAILED on test 18 + + Another file permissions test fails. + + lib/gdbm.......FAILED on test 2 + + Another file permissions test fails. + + lib/sdbm.......FAILED on test 2 + + Another file permissions test fails. + + Failed 11/94 tests, 88.30% okay. + + All of which are known differences with unix or documented + behaviors in EMX. I re-run the test with Ilya's version, + and the same tests fail. This new build is a success. + [Note that bad free() mentioned above are bugs in the Berkeley + DB. They just are more visible under OS/2 with perl free(), because of + "rigid" function name resolution. + To get finer tests, cd to ./t and run + perl harness + ] + + (Actually, Ilya's perl release fails an extra test because I don't + have sed in f:\emx.add. This shows how important it is to configure + and build perl yourself instead of grabbing pre-built binaries.) + [Hmm, should not happen... There is no mentions of full_sed under ./t + directory...] + + >>> Cross your fingers and install it: + + make install + + Warnings encountered and workarounds presented.: + + WARNING: You've never run 'make test'!!! (Installing anyway.) + (Lies! All lies! At least it still installs.) + + WARNING: Can't find libperl*.dll* to install into \ + f:/usr/lib/perl5/os2/5.00201/CORE. (Installing other things anyway.) + (Safe to ignore. The important one, libperl.lib, gets copied.) + + Couldn't copy f:/usr/bin/perl5.00201.exe to f:/usr/bin/perl.exe: \ + No such file or directory + cp /usr/bin/perl5.00201.exe /usr/bin/perl.exe + + Couldn't copy f:/usr/bin/perl.exe to /usr/bin/perl.exe: No such \ + file or directory + (I think this one is safe to ignore since the two directories + point to the same place.) + + >>> Laugh maniacally because you just built and installed your own copy + of perl, with all the paths set "just so" and with whatever little + psychotic modifications you've always wanted but were afraid to add. + + ----------------------------------------------------------------------------- + + Development tools and versions: + + EMX 0.9b with emxfix04 applied. + + `ls --version` reports: 'GNU file utilities 3.12' + `tr --version` reports: 'tr - GNU textutils 1.14' + `id --version` reports: 'id - GNU sh-utils 1.12' + + `sed --version` reports: 'GNU sed version 2.05' + `awk --version` reports: 'Gnu Awk (gawk) 2.15, patchlevel 6' + `grep --version` reports an illegal option and: 'GNU grep version 2.0' + (this includes egrep) + + `sort --version` reports: 'sort - GNU textutils 1.14' + `uniq --version` reports: 'uniq - GNU textutils 1.14' + `find --version` reports: 'GNU find version 4.1' + + KSH_VERSION='@(#)PD KSH v5.2.4 96/01/17' + (Ilya's patched version.) + + `make --version` reports: 'GNU Make version 3.74' + (Ilya's patched version.) + + `emxrev` reports: + EMX : revision = 42 + EMXIO : revision = 40 + EMXLIBC : revision = 40 + EMXLIBCM : revision = 43 + EMXLIBCS : revision = 43 + EMXWRAP : revision = 40 + + ----------------------------------------------------------------------------- + + Rocco + + #~ New for Plan9 support diff -Pcr perl5_003/README.plan9 perl5_003_01/README.plan9 *** perl5_003/README.plan9 Wed Dec 31 19:00:00 1969 --- perl5_003_01/README.plan9 Wed Jul 17 19:05:02 1996 *************** *** 0 **** --- 1,27 ---- + WELCOME to Plan 9 Perl, brave soul! + This is a preliminary alpha version of Plan 9 Perl. Still to be implemented are MakeMaker and DynaLoader. Many perl commands are missing or currently behave in an inscrutable manner. These gaps will, with perserverance and a modicum of luck, be remedied in the near future.To install this software: + + 1. Create the source directories and libraries for perl by running the plan9/setup.rc command (i.e., located in the plan9 subdirectory). Note: the setup routine assumes that you haven't dearchived these files into /sys/src/cmd/perl. After running setup.rc you may delete the copy of the source you originally detarred, as source code has now been installed in /sys/src/cmd/perl. If you plan on installing perl binaries for all architectures, run "setup.rc -a". + After + 2. Making sure that you have adequate privileges to build system software, from /sys/src/cmd/perl/5.00301 run: + mk install + If you wish to install perl versions for all architectures (68020, mips, sparc and 386) run: + mk installall + + 3. Wait. The build process will take a *long* time because perl bootstraps itself. A 75MHz Pentium, 16MB RAM machine takes roughly 30 minutes to build the distribution from scratch. + + INSTALLING DOCUMENTATION + This perl distribution comes with a tremendous amount of documentation. To add these to the built-in manuals that come with Plan 9, from /sys/src/cmd/perl/5.00301 run: + mk man + To begin your reading, start with: + man perl + This is a good introduction and will direct you towards other man pages that may interest you. For information specific to Plan 9 Perl, try: + man perlplan9 + + (Note: "mk man" may produce some extraneous noise. Fear not.) + + Direct questions, comments, and the unlikely bug report (ahem) direct comments toward: + lutherh@stratcom.com + + Luther Huffman + Strategic Computer Solutions, Inc. #~ Change global symbol 'stack' to avoid collision with other code #~ Add warning for multiple attampts to delete an AV. diff -Pcr perl5_003/av.c perl5_003_01/av.c *** perl5_003/av.c Tue Jan 30 20:33:11 1996 --- perl5_003_01/av.c Fri Jul 5 18:01:23 1996 *************** *** 94,100 **** #endif ary = AvALLOC(av) + AvMAX(av) + 1; tmp = newmax - AvMAX(av); ! if (av == stack) { /* Oops, grew stack (via av_store()?) */ stack_sp = AvALLOC(av) + (stack_sp - stack_base); stack_base = AvALLOC(av); stack_max = stack_base + newmax; --- 94,100 ---- #endif ary = AvALLOC(av) + AvMAX(av) + 1; tmp = newmax - AvMAX(av); ! if (av == curstack) { /* Oops, grew stack (via av_store()?) */ stack_sp = AvALLOC(av) + (stack_sp - stack_base); stack_base = AvALLOC(av); stack_max = stack_base + newmax; *************** *** 196,202 **** ary = AvARRAY(av); if (AvFILL(av) < key) { if (!AvREAL(av)) { ! if (av == stack && key > stack_sp - stack_base) stack_sp = stack_base + key; /* XPUSH in disguise */ do ary[++AvFILL(av)] = &sv_undef; --- 196,202 ---- ary = AvARRAY(av); if (AvFILL(av) < key) { if (!AvREAL(av)) { ! if (av == curstack && key > stack_sp - stack_base) stack_sp = stack_base + key; /* XPUSH in disguise */ do ary[++AvFILL(av)] = &sv_undef; *************** *** 289,294 **** --- 289,299 ---- register I32 key; SV** ary; + #ifdef DEBUGGING + if (SvREFCNT(av) <= 0) { + warn("Attempt to clear deleted array"); + } + #endif if (!av || AvMAX(av) < 0) return; /*SUPPRESS 560*/ #~ Remove old version of target before creating new one diff -Pcr perl5_003/cflags.SH perl5_003_01/cflags.SH *** perl5_003/cflags.SH Sat Jan 20 00:53:39 1996 --- perl5_003_01/cflags.SH Thu Jul 11 12:25:13 1996 *************** *** 21,26 **** --- 21,27 ---- : Move anything that needs config subs from !NO!SUBS! section to !GROK!THIS!. : Protect any dollar signs and backticks that you do not want interpreted : by putting a backslash in front. You may delete these comments. + rm -f cflags $spitshell >cflags <config.h -e 's!^#undef!/\*#define!' -e 's!^#un-def!#undef!' /* * This file was produced by running the config_h.SH script, which *************** *** 25,31 **** * that running config_h.SH again will wipe out any changes you've made. * For a more permanent change edit config.sh and rerun config_h.SH. * ! * \$Id: Config_h.U,v 3.0.1.4 1995/09/25 09:10:49 ram Exp $ */ /* Configuration time: $cf_time --- 34,40 ---- * that running config_h.SH again will wipe out any changes you've made. * For a more permanent change edit config.sh and rerun config_h.SH. * ! * \$Id: config_h.SH,v 1.2 1996/07/05 23:49:13 gerti Exp $ */ /* Configuration time: $cf_time *************** *** 1342,1348 **** --- 1351,1367 ---- * This symbol hold the hexadecimal constant defined in byteorder, * i.e. 0x1234 or 0x4321, etc... */ + #ifndef NeXT #define BYTEORDER 0x$byteorder /* large digits for MSB */ + #else /* NeXT */ + + #ifdef __BIG_ENDIAN__ + #define BYTEORDER 0x4321 + #else /* __LITTLE_ENDIAN__ */ + #define BYTEORDER 0x1234 + #endif /* ENDIAN CHECK */ + + #endif /* !NeXT */ /* CSH: * This symbol, if defined, indicates that the C-shell exists. *************** *** 1567,1572 **** --- 1586,1596 ---- * some shell. */ #define STARTPERL "$startperl" /**/ + + /* BIN_SH: + * This variable contains the path to the shell. + */ + #define BIN_SH "$bin_sh" /**/ /* VOIDFLAGS: * This symbol indicates how much support of the void type is given by this #~ Output line number in die message for version mismatch #~ Add config_re subroutine #~ Preload aout-specific values in OS/2 aout Perl #~ Change end-of-block token diff -Pcr perl5_003/configpm perl5_003_01/configpm *** perl5_003/configpm Tue Feb 27 15:47:38 1996 --- perl5_003_01/configpm Mon Jul 15 13:38:04 1996 *************** *** 26,32 **** \@EXPORT_OK = qw(myconfig config_sh config_vars); \$] == $myver ! or die "Perl lib version ($myver) doesn't match executable version (\$])\\n"; # This file was created by configpm when Perl was built. Any changes # made to this file will be lost the next time perl is built. --- 26,32 ---- \@EXPORT_OK = qw(myconfig config_sh config_vars); \$] == $myver ! or die "Perl lib version ($myver) doesn't match executable version (\$])"; # This file was created by configpm when Perl was built. Any changes # made to this file will be lost the next time perl is built. *************** *** 85,92 **** print CONFIG <<'ENDOFEND'; - tie %Config, Config; - sub TIEHASH { bless {} } sub FETCH { # check for cached value (which maybe undef so we use exists not defined) return $_[0]->{$_[1]} if (exists $_[0]->{$_[1]}); --- 85,90 ---- *************** *** 126,139 **** --- 124,169 ---- sub config_sh { $config_sh } + + sub config_re { + my $re = shift; + my @matches = ($config_sh =~ /^$re=.*\n/mg); + @matches ? (print @matches) : print "$re: not found\n"; + } + sub config_vars { foreach(@_){ + config_re($_), next if /\W/; my $v=(exists $Config{$_}) ? $Config{$_} : 'UNKNOWN'; $v='undef' unless defined $v; print "$_='$v';\n"; } } + ENDOFEND + + if ($^O eq 'os2') { + print CONFIG <<'ENDOFSET'; + my %preconfig; + if ($OS2::is_aout) { + my ($value, $v) = $config_sh =~ m/^used_aout='(.*)'\s*$/m; + for (split ' ', $value) { + ($v) = $config_sh =~ m/^aout_$_='(.*)'\s*$/m; + $preconfig{$_} = $v eq 'undef' ? undef : $v; + } + } + sub TIEHASH { bless {%preconfig} } + ENDOFSET + } else { + print CONFIG <<'ENDOFSET'; + sub TIEHASH { bless {} } + ENDOFSET + } + + print CONFIG <<'ENDOFTAIL'; + + tie %Config, 'Config'; + 1; __END__ *************** *** 229,235 **** =cut ! ENDOFEND close(CONFIG); --- 259,265 ---- =cut ! ENDOFTAIL close(CONFIG); #~ Increment refcount on @_ when passed through to another sub, #~ so it's not freed twiceon return. diff -Pcr perl5_003/cop.h perl5_003_01/cop.h *** perl5_003/cop.h Sun Jan 28 01:19:07 1996 --- perl5_003_01/cop.h Fri Jul 5 18:01:26 1996 *************** *** 52,57 **** --- 52,60 ---- } \ if (cx->blk_sub.cv) { \ if (!(CvDEPTH(cx->blk_sub.cv) = cx->blk_sub.olddepth)) { \ + if (cx->blk_sub.hasargs) { \ + SvREFCNT_inc((SV*)cx->blk_sub.argarray); \ + } \ SvREFCNT_dec((SV*)cx->blk_sub.cv); \ } \ } #~ Add configurable destination for debug messages diff -Pcr perl5_003/deb.c perl5_003_01/deb.c *** perl5_003/deb.c Thu Jan 19 19:06:23 1995 --- perl5_003_01/deb.c Thu Jul 4 14:47:45 1996 *************** *** 30,41 **** register I32 i; GV* gv = curcop->cop_filegv; ! fprintf(stderr,"(%s:%ld)\t", SvTYPE(gv) == SVt_PVGV ? SvPVX(GvSV(gv)) : "", (long)curcop->cop_line); for (i=0; icop_filegv; ! fprintf(Perl_debug_log,"(%s:%ld)\t", SvTYPE(gv) == SVt_PVGV ? SvPVX(GvSV(gv)) : "", (long)curcop->cop_line); for (i=0; icop_filegv; ! fprintf(stderr,"(%s:%ld)\t", SvTYPE(gv) == SVt_PVGV ? SvPVX(GvSV(gv)) : "", (long)curcop->cop_line); for (i=0; icop_filegv; ! fprintf(Perl_debug_log,"(%s:%ld)\t", SvTYPE(gv) == SVt_PVGV ? SvPVX(GvSV(gv)) : "", (long)curcop->cop_line); for (i=0; i= i) break; ! fprintf(stderr, i ? " => ... " : " => "); if (stack_base[0] != &sv_undef || stack_sp < stack_base) ! fprintf(stderr, " [STACK UNDERFLOW!!!]\n"); do { ++i; if (markscan <= markstack_ptr && *markscan < i) { do { ++markscan; ! putc('*', stderr); } while (markscan <= markstack_ptr && *markscan < i); ! fprintf(stderr, " "); } if (i > top) break; ! fprintf(stderr, "%-4s ", SvPEEK(stack_base[i])); } while (1); ! fprintf(stderr, "\n"); return 0; } #else --- 106,130 ---- if (*markscan >= i) break; ! fprintf(Perl_debug_log, i ? " => ... " : " => "); if (stack_base[0] != &sv_undef || stack_sp < stack_base) ! fprintf(Perl_debug_log, " [STACK UNDERFLOW!!!]\n"); do { ++i; if (markscan <= markstack_ptr && *markscan < i) { do { ++markscan; ! putc('*', Perl_debug_log); } while (markscan <= markstack_ptr && *markscan < i); ! fprintf(Perl_debug_log, " "); } if (i > top) break; ! fprintf(Perl_debug_log, "%-4s ", SvPEEK(stack_base[i])); } while (1); ! fprintf(Perl_debug_log, "\n"); return 0; } #else #~ Add curlies to nested expression for clarity #~ Rename keyword 'explicit' to eliminate C++ collision #~ Rename chsize() function to avoid collision with libc on some systems #~ Use macro for shell name as part of OS/2 support #~ Support 64-bit times diff -Pcr perl5_003/doio.c perl5_003_01/doio.c *** perl5_003/doio.c Tue Feb 27 16:29:23 1996 --- perl5_003_01/doio.c Sat Jul 20 19:56:18 1996 *************** *** 192,200 **** } if (dodup) fd = dup(fd); ! if (!(fp = fdopen(fd,mode))) if (dodup) close(fd); } } else { --- 192,201 ---- } if (dodup) fd = dup(fd); ! if (!(fp = fdopen(fd,mode))) { if (dodup) close(fd); + } } } else { *************** *** 520,532 **** } #endif bool #ifndef CAN_PROTOTYPE ! do_close(gv,explicit) GV *gv; ! bool explicit; #else ! do_close(GV *gv, bool explicit) #endif /* CAN_PROTOTYPE */ { bool retval; --- 521,534 ---- } #endif + /* explicit renamed to avoid C++ conflict -- kja */ bool #ifndef CAN_PROTOTYPE ! do_close(gv,not_implicit) GV *gv; ! bool not_implicit; #else ! do_close(GV *gv, bool not_implicit) #endif /* CAN_PROTOTYPE */ { bool retval; *************** *** 540,551 **** } io = GvIO(gv); if (!io) { /* never opened */ ! if (dowarn && explicit) warn("Close on unopened file <%s>",GvENAME(gv)); return FALSE; } retval = io_close(io); ! if (explicit) { IoLINES(io) = 0; IoPAGE(io) = 0; IoLINES_LEFT(io) = IoPAGE_LEN(io); --- 542,553 ---- } io = GvIO(gv); if (!io) { /* never opened */ ! if (dowarn && not_implicit) warn("Close on unopened file <%s>",GvENAME(gv)); return FALSE; } retval = io_close(io); ! if (not_implicit) { IoLINES(io) = 0; IoPAGE(io) = 0; IoLINES_LEFT(io) = IoPAGE_LEN(io); *************** *** 681,687 **** /* code courtesy of William Kucharski */ #define HAS_CHSIZE ! I32 chsize(fd, length) I32 fd; /* file descriptor */ Off_t length; /* length to set file to */ { --- 683,689 ---- /* code courtesy of William Kucharski */ #define HAS_CHSIZE ! I32 my_chsize(fd, length) I32 fd; /* file descriptor */ Off_t length; /* length to set file to */ { *************** *** 1012,1018 **** break; } doshell: ! execl("/bin/sh","sh","-c",cmd,(char*)0); return FALSE; } } --- 1014,1020 ---- break; } doshell: ! execl(SH_PATH, "sh", "-c", cmd, (char*)0); return FALSE; } } *************** *** 1188,1195 **** --- 1190,1202 ---- #endif Zero(&utbuf, sizeof utbuf, char); + #ifdef BIG_TIME + utbuf.actime = (Time_t)SvNVx(*++mark); /* time accessed */ + utbuf.modtime = (Time_t)SvNVx(*++mark); /* time modified */ + #else utbuf.actime = SvIVx(*++mark); /* time accessed */ utbuf.modtime = SvIVx(*++mark); /* time modified */ + #endif tot = sp - mark; while (++mark <= sp) { if (utime(SvPVx(*mark, na),&utbuf)) #~ Fix length test so chomp won't clip strings shorter than $/ #~ Incorporate shared hash key support diff -Pcr perl5_003/doop.c perl5_003_01/doop.c *** perl5_003/doop.c Fri Jan 26 18:58:10 1996 --- perl5_003_01/doop.c Tue Jun 18 21:52:39 1996 *************** *** 494,500 **** ++count; } else { ! if (len < rslen) goto nope; len -= rslen - 1; s -= rslen - 1; --- 494,500 ---- ++count; } else { ! if (len < rslen - 1) goto nope; len -= rslen - 1; s -= rslen - 1; *************** *** 622,630 **** { dSP; HV *hv = (HV*)POPs; - I32 i; register HE *entry; - char *tmps; SV *tmpstr; I32 dokeys = (op->op_type == OP_KEYS); I32 dovalues = (op->op_type == OP_VALUES); --- 622,628 ---- *************** *** 638,643 **** --- 636,642 ---- (void)hv_iterinit(hv); /* always reset iterator regardless */ if (GIMME != G_ARRAY) { + I32 i; dTARGET; if (!SvRMAGICAL(hv) || !mg_find((SV*)hv,'P')) *************** *** 659,679 **** PUTBACK; /* hv_iternext and hv_iterval might clobber stack_sp */ while (entry = hv_iternext(hv)) { SPAGAIN; ! if (dokeys) { ! tmps = hv_iterkey(entry,&i); /* won't clobber stack_sp */ ! if (!i) ! tmps = ""; ! XPUSHs(sv_2mortal(newSVpv(tmps,i))); ! } if (dovalues) { tmpstr = NEWSV(45,0); PUTBACK; sv_setsv(tmpstr,hv_iterval(hv,entry)); SPAGAIN; DEBUG_H( { ! sprintf(buf,"%d%%%d=%d\n",entry->hent_hash, ! HvMAX(hv)+1,entry->hent_hash & HvMAX(hv)); ! sv_setpv(tmpstr,buf); } ) XPUSHs(sv_2mortal(tmpstr)); } --- 658,674 ---- PUTBACK; /* hv_iternext and hv_iterval might clobber stack_sp */ while (entry = hv_iternext(hv)) { SPAGAIN; ! if (dokeys) ! XPUSHs(hv_iterkeysv(entry)); /* won't clobber stack_sp */ if (dovalues) { tmpstr = NEWSV(45,0); PUTBACK; sv_setsv(tmpstr,hv_iterval(hv,entry)); SPAGAIN; DEBUG_H( { ! sprintf(buf,"%d%%%d=%d\n", HeHASH(entry), ! HvMAX(hv)+1, HeHASH(entry) & HvMAX(hv)); ! sv_setpv(tmpstr,buf); } ) XPUSHs(sv_2mortal(tmpstr)); } #~ Supply OS-specific values for macros added as part of Plan9 and VMS support diff -Pcr perl5_003/dosish.h perl5_003_01/dosish.h *** perl5_003/dosish.h Mon Mar 25 01:04:03 1996 --- perl5_003_01/dosish.h Thu Jul 25 16:12:47 1996 *************** *** 6,11 **** --- 6,32 ---- #define dXSUB_SYS int dummy #define TMPPATH "plXXXXXX" + /* USEMYBINMODE + * This symbol, if defined, indicates that the program should + * use the routine my_binmode(FILE *fp, char iotype) to insure + * that a file is in "binary" mode -- that is, that no translation + * of bytes occurs on read or write operations. + */ + #undef USEMYBINMODE + + /* USE_STAT_RDEV: + * This symbol is defined if this system has a stat structure declaring + * st_rdev + */ + #define USE_STAT_RDEV /**/ + + /* ACME_MESS: + * This symbol, if defined, indicates that error messages should be + * should be generated in a format that allows the use of the Acme + * GUI/editor's autofind feature. + */ + #undef ACME_MESS /**/ + /* * fwrite1() should be a routine with the same calling sequence as fwrite(), * but which outputs all of the bytes requested as a single stream (unlike #~ Use varargs prototype for dump() #~ Use configurable destination for "error" output #~ Incorporate shared hash key support diff -Pcr perl5_003/dump.c perl5_003_01/dump.c *** perl5_003/dump.c Sun Jan 28 00:15:09 1996 --- perl5_003_01/dump.c Fri Jun 21 11:22:14 1996 *************** *** 22,36 **** } #else /* Rest of file is for DEBUGGING */ static void dump(); void dump_all() { #ifdef HAS_SETLINEBUF ! setlinebuf(stderr); #else ! setvbuf(stderr, Nullch, _IOLBF, 0); #endif if (main_root) dump_op(main_root); --- 22,48 ---- } #else /* Rest of file is for DEBUGGING */ + #ifdef I_STDARG + static void dump(char *pat, ...); + #else + # if defined(I_VARARGS) + /*VARARGS0*/ + static void + dump(pat, va_alist) + char *pat; + va_dcl + # else static void dump(); + # endif + #endif void dump_all() { #ifdef HAS_SETLINEBUF ! setlinebuf(Perl_debug_log); #else ! setvbuf(Perl_debug_log, Nullch, _IOLBF, 0); #endif if (main_root) dump_op(main_root); *************** *** 47,60 **** if (!HvARRAY(stash)) return; for (i = 0; i <= (I32) HvMAX(stash); i++) { ! for (entry = HvARRAY(stash)[i]; entry; entry = entry->hent_next) { ! GV *gv = (GV*)entry->hent_val; HV *hv; if (GvCV(gv)) dump_sub(gv); if (GvFORM(gv)) dump_form(gv); ! if (entry->hent_key[entry->hent_klen-1] == ':' && (hv = GvHV(gv)) && HvNAME(hv) && hv != defstash) dump_packsubs(hv); /* nested package */ } --- 59,72 ---- if (!HvARRAY(stash)) return; for (i = 0; i <= (I32) HvMAX(stash); i++) { ! for (entry = HvARRAY(stash)[i]; entry; entry = HeNEXT(entry)) { ! GV *gv = (GV*)HeVAL(entry); HV *hv; if (GvCV(gv)) dump_sub(gv); if (GvFORM(gv)) dump_form(gv); ! if (HeKEY(entry)[HeKLEN(entry)-1] == ':' && (hv = GvHV(gv)) && HvNAME(hv) && hv != defstash) dump_packsubs(hv); /* nested package */ } *************** *** 107,124 **** dump("{\n"); if (op->op_seq) ! fprintf(stderr, "%-4d", op->op_seq); else ! fprintf(stderr, " "); dump("TYPE = %s ===> ", op_name[op->op_type]); if (op->op_next) { if (op->op_seq) ! fprintf(stderr, "%d\n", op->op_next->op_seq); else ! fprintf(stderr, "(%d)\n", op->op_next->op_seq); } else ! fprintf(stderr, "DONE\n"); dumplvl++; if (op->op_targ) { if (op->op_type == OP_NULL) --- 119,136 ---- dump("{\n"); if (op->op_seq) ! fprintf(Perl_debug_log, "%-4d", op->op_seq); else ! fprintf(Perl_debug_log, " "); dump("TYPE = %s ===> ", op_name[op->op_type]); if (op->op_next) { if (op->op_seq) ! fprintf(Perl_debug_log, "%d\n", op->op_next->op_seq); else ! fprintf(Perl_debug_log, "(%d)\n", op->op_next->op_seq); } else ! fprintf(Perl_debug_log, "DONE\n"); dumplvl++; if (op->op_targ) { if (op->op_type == OP_NULL) *************** *** 243,273 **** case OP_ENTERLOOP: dump("REDO ===> "); if (cLOOP->op_redoop) ! fprintf(stderr, "%d\n", cLOOP->op_redoop->op_seq); else ! fprintf(stderr, "DONE\n"); dump("NEXT ===> "); if (cLOOP->op_nextop) ! fprintf(stderr, "%d\n", cLOOP->op_nextop->op_seq); else ! fprintf(stderr, "DONE\n"); dump("LAST ===> "); if (cLOOP->op_lastop) ! fprintf(stderr, "%d\n", cLOOP->op_lastop->op_seq); else ! fprintf(stderr, "DONE\n"); break; case OP_COND_EXPR: dump("TRUE ===> "); if (cCONDOP->op_true) ! fprintf(stderr, "%d\n", cCONDOP->op_true->op_seq); else ! fprintf(stderr, "DONE\n"); dump("FALSE ===> "); if (cCONDOP->op_false) ! fprintf(stderr, "%d\n", cCONDOP->op_false->op_seq); else ! fprintf(stderr, "DONE\n"); break; case OP_MAPWHILE: case OP_GREPWHILE: --- 255,285 ---- case OP_ENTERLOOP: dump("REDO ===> "); if (cLOOP->op_redoop) ! fprintf(Perl_debug_log, "%d\n", cLOOP->op_redoop->op_seq); else ! fprintf(Perl_debug_log, "DONE\n"); dump("NEXT ===> "); if (cLOOP->op_nextop) ! fprintf(Perl_debug_log, "%d\n", cLOOP->op_nextop->op_seq); else ! fprintf(Perl_debug_log, "DONE\n"); dump("LAST ===> "); if (cLOOP->op_lastop) ! fprintf(Perl_debug_log, "%d\n", cLOOP->op_lastop->op_seq); else ! fprintf(Perl_debug_log, "DONE\n"); break; case OP_COND_EXPR: dump("TRUE ===> "); if (cCONDOP->op_true) ! fprintf(Perl_debug_log, "%d\n", cCONDOP->op_true->op_seq); else ! fprintf(Perl_debug_log, "DONE\n"); dump("FALSE ===> "); if (cCONDOP->op_false) ! fprintf(Perl_debug_log, "%d\n", cCONDOP->op_false->op_seq); else ! fprintf(Perl_debug_log, "DONE\n"); break; case OP_MAPWHILE: case OP_GREPWHILE: *************** *** 275,283 **** case OP_AND: dump("OTHER ===> "); if (cLOGOP->op_other) ! fprintf(stderr, "%d\n", cLOGOP->op_other->op_seq); else ! fprintf(stderr, "DONE\n"); break; case OP_PUSHRE: case OP_MATCH: --- 287,295 ---- case OP_AND: dump("OTHER ===> "); if (cLOGOP->op_other) ! fprintf(Perl_debug_log, "%d\n", cLOGOP->op_other->op_seq); else ! fprintf(Perl_debug_log, "DONE\n"); break; case OP_PUSHRE: case OP_MATCH: *************** *** 303,314 **** SV *sv; if (!gv) { ! fprintf(stderr,"{}\n"); return; } sv = sv_newmortal(); dumplvl++; ! fprintf(stderr,"{\n"); gv_fullname(sv,gv); dump("GV_NAME = %s", SvPVX(sv)); if (gv != GvEGV(gv)) { --- 315,326 ---- SV *sv; if (!gv) { ! fprintf(Perl_debug_log,"{}\n"); return; } sv = sv_newmortal(); dumplvl++; ! fprintf(Perl_debug_log,"{\n"); gv_fullname(sv,gv); dump("GV_NAME = %s", SvPVX(sv)); if (gv != GvEGV(gv)) { *************** *** 378,383 **** --- 390,397 ---- dump("}\n"); } + + #if !defined(I_STDARG) && !defined(I_VARARGS) /* VARARGS1 */ static void dump(arg1,arg2,arg3,arg4,arg5) char *arg1; *************** *** 386,392 **** I32 i; for (i = dumplvl*4; i; i--) (void)putc(' ',stderr); ! fprintf(stderr,arg1, arg2, arg3, arg4, arg5); } #endif --- 400,438 ---- I32 i; for (i = dumplvl*4; i; i--) + (void)putc(' ',Perl_debug_log); + fprintf(Perl_debug_log,arg1, arg2, arg3, arg4, arg5); + } + + #else + + #ifdef I_STDARG + static void + dump(char *pat,...) + #else + /*VARARGS0*/ + static void + dump(pat,va_alist) + char *pat; + va_dcl + #endif + { + I32 i; + va_list args; + #ifndef HAS_VPRINTF + int vfprintf(); + #endif + + #ifdef I_STDARG + va_start(args, pat); + #else + va_start(args); + #endif + for (i = dumplvl*4; i; i--) (void)putc(' ',stderr); ! vfprintf(Perl_debug_log,pat,args); ! va_end(args); } + #endif + #endif #~ Update to v1.24 diff -Pcr perl5_003/emacs/cperl-mode.el perl5_003_01/emacs/cperl-mode.el *** perl5_003/emacs/cperl-mode.el Mon Feb 12 14:49:43 1996 --- perl5_003_01/emacs/cperl-mode.el Fri Jul 5 13:47:35 1996 *************** *** 27,33 **** ;;; Corrections made by Ilya Zakharevich ilya@math.mps.ohio-state.edu ;;; XEmacs changes by Peter Arius arius@informatik.uni-erlangen.de ! ;; $Id: cperl-mode.el,v 1.20 1996/02/09 03:40:01 ilya Exp ilya $ ;;; To use this mode put the following into your .emacs file: --- 27,33 ---- ;;; Corrections made by Ilya Zakharevich ilya@math.mps.ohio-state.edu ;;; XEmacs changes by Peter Arius arius@informatik.uni-erlangen.de ! ;; $Id: cperl-mode.el,v 1.24 1996/07/04 02:14:27 ilya Exp ilya $ ;;; To use this mode put the following into your .emacs file: *************** *** 245,250 **** --- 245,286 ---- ;;; pod sections which are broken because of whitespace before =blah ;;; - just observe the fontification. + ;;;; After 1.20 + ;;; Anonymous subs are indented with respect to the level of + ;;; indentation of `sub' now. + ;;; {} is recognized as hash after `bless' and `return'. + ;;; Anonymous subs are split by `cperl-linefeed' as well. + ;;; Electric parens embrace a region if present. + ;;; To make `cperl-auto-newline' useful, + ;;; `cperl-auto-newline-after-colon' is introduced. + ;;; `cperl-electric-parens' is now t or nul. The old meaning is moved to + ;;; `cperl-electric-parens-string'. + ;;; `cperl-toggle-auto-newline' introduced, put on C-c C-a. + ;;; `cperl-toggle-abbrev' introduced, put on C-c C-k. + ;;; `cperl-toggle-electric' introduced, put on C-c C-e. + ;;; Beginning-of-defun-regexp was not anchored. + + ;;;; After 1.21 + ;;; Auto-newline grants `cperl-extra-newline-before-brace' if "{" is typed + ;;; after ")". + ;;; {} is recognized as expression after `tr' and friends. + + ;;;; After 1.22 + ;;; Entry Hierarchy added to imenu. Very primitive so far. + ;;; One needs newer `imenu-go'.el. A patch to `imenu' is needed as well. + ;;; Writes its own TAGS files. + ;;; Class viewer based on TAGS files. Does not trace @ISA so far. + ;;; 19.31: Problems with scan for PODs corrected. + ;;; First POD header correctly fontified. + ;;; I needed (setq imenu-use-keymap-menu t) to get good imenu in 19.31. + ;;; Apparently it makes a lot of hierarchy code obsolete... + + ;;;; After 1.23 + ;;; Tags filler now scans *.xs as well. + ;;; The info from *.xs scan is used by the hierarchy viewer. + ;;; Hierarchy viewer documented. + ;;; Bug in 19.31 imenu documented. + (defvar cperl-extra-newline-before-brace nil "*Non-nil means that if, elsif, while, until, else, for, foreach and do constructs look like: *************** *** 284,290 **** (defvar cperl-auto-newline nil "*Non-nil means automatically newline before and after braces, ! and after colons and semicolons, inserted in CPerl code.") (defvar cperl-tab-always-indent t "*Non-nil means TAB in CPerl mode should always reindent the current line, --- 320,333 ---- (defvar cperl-auto-newline nil "*Non-nil means automatically newline before and after braces, ! and after colons and semicolons, inserted in CPerl code. The following ! \\[cperl-electric-backspace] will remove the inserted whitespace. ! Insertion after colons requires both this variable and ! `cperl-auto-newline-after-colon' set.") ! ! (defvar cperl-auto-newline-after-colon nil ! "*Non-nil means automatically newline even after colons. ! Subject to `cperl-auto-newline' setting.") (defvar cperl-tab-always-indent t "*Non-nil means TAB in CPerl mode should always reindent the current line, *************** *** 298,306 **** "*Non-nil (and non-null) means { after $ in CPerl buffers should be preceeded by ` '. Can be overwritten by `cperl-hairy' if nil.") ! (defvar cperl-electric-parens "" ! "*List of parentheses that should be electric in CPerl, or null. ! Can be overwritten by `cperl-hairy' to \"({[<\" if not 'null.") (defvar cperl-electric-linefeed nil "*If true, LFD should be hairy in CPerl, otherwise C-c LFD is hairy. --- 341,364 ---- "*Non-nil (and non-null) means { after $ in CPerl buffers should be preceeded by ` '. Can be overwritten by `cperl-hairy' if nil.") ! (defvar cperl-electric-parens-string "({[<" ! "*String of parentheses that should be electric in CPerl.") ! ! (defvar cperl-electric-parens nil ! "*Non-nil (and non-null) means parentheses should be electric in CPerl. ! Can be overwritten by `cperl-hairy' if nil.") ! (defvar cperl-electric-parens-mark ! (and window-system ! (or (and (boundp 'transient-mark-mode) ; For Emacs ! transient-mark-mode) ! (and (boundp 'zmacs-regions) ; For XEmacs ! zmacs-regions))) ! "*Not-nil means that electric parens look for active mark. ! Default is yes if there is visual feedback on mark.") ! ! (defvar cperl-electric-parens-mark (and window-system transient-mark-mode) ! "*Not-nil means that electric parens look for active mark. ! Default is yes if there is visual feedback on mark.") (defvar cperl-electric-linefeed nil "*If true, LFD should be hairy in CPerl, otherwise C-c LFD is hairy. *************** *** 343,348 **** --- 401,410 ---- "*Not-nil means look for pod and here-docs sections during startup. You can always make lookup from menu or using \\[cperl-find-pods-heres].") + (defvar cperl-imenu-addback nil + "*Not-nil means add backreferences to generated `imenu's. + May require patched `imenu' and `imenu-go'.") + ;;; Short extra-docs. *************** *** 353,362 **** and/or ftp://ftp.math.ohio-state.edu/pub/users/ilya/perl ! Get support packages font-lock-extra.el, imenu-go.el from the same place. ! \(Look for other files there too... ;-) Get a patch for imenu.el in 19.29. ! Note that for 19.30 you should use choose-color.el *instead* of ! font-lock-extra.el (and you will not get smart highlighting in C :-(). Note that to enable Compile choices in the menu you need to install mode-compile.el. --- 415,425 ---- and/or ftp://ftp.math.ohio-state.edu/pub/users/ilya/perl ! Get support packages choose-color.el (or font-lock-extra.el before ! 19.30), imenu-go.el from the same place. \(Look for other files there ! too... ;-) Get a patch for imenu.el in 19.29. Note that for 19.30 and ! later you should use choose-color.el *instead* of font-lock-extra.el ! \(and you will not get smart highlighting in C :-(). Note that to enable Compile choices in the menu you need to install mode-compile.el. *************** *** 365,372 **** http://www.metronet.com:70/9/perlinfo/perl5/manual/perl5-info.tar.gz \(may be quite obsolete, but still useful). ! If you use imenu-go, run imenu on perl5-info buffer (you can do it from ! CPerl menu). Before reporting (non-)problems look in the problem section on what I know about them.") --- 428,441 ---- http://www.metronet.com:70/9/perlinfo/perl5/manual/perl5-info.tar.gz \(may be quite obsolete, but still useful). ! If you use imenu-go, run imenu on perl5-info buffer (you can do it ! from CPerl menu). If many files are related, generate TAGS files from ! Tools/Tags submenu in CPerl menu. ! ! If some class structure is too complicated, use Tools/Hierarchy-view ! from CPerl menu, or hierarchic view of imenu. The second one is very ! rudimental, the first one requires generation of TAGS from ! CPerl/Tools/Tags menu beforehand. Before reporting (non-)problems look in the problem section on what I know about them.") *************** *** 374,381 **** (defvar cperl-problems 'please-ignore-this-line "Emacs has a _very_ restricted syntax parsing engine. ! It may be corrected on the level of C ocde, please look in the ! `non-problems' section if you want to volonteer. CPerl mode tries to corrects some Emacs misunderstandings, however, for effeciency reasons the degree of correction is different for --- 443,450 ---- (defvar cperl-problems 'please-ignore-this-line "Emacs has a _very_ restricted syntax parsing engine. ! It may be corrected on the level of C code, please look in the ! `non-problems' section if you want to volunteer. CPerl mode tries to corrects some Emacs misunderstandings, however, for effeciency reasons the degree of correction is different for *************** *** 435,440 **** --- 504,513 ---- a) sub in $mypackage::sub may be highlighted. b) -z in [a-z] may be highlighted. c) if your regexp contains a keyword (like \"s\"), it may be highlighted. + + + Imenu in 19.31 is broken. Set `imenu-use-keymap-menu' to t, and remove + `car' before `imenu-choose-buffer-index' in `imenu'. ") *************** *** 452,463 **** (setq del-back-ch (aref del-back-ch 0))) (if (cperl-xemacs-p) ! ;; "Active regions" are on: use region only if active ! ;; "Active regions" are off: use region unconditionally ! (defun cperl-use-region-p () ! (if zmacs-regions (mark) t)) (defun cperl-use-region-p () ! (if transient-mark-mode mark-active t))) (defsubst cperl-enable-font-lock () (or (cperl-xemacs-p) window-system)) --- 525,539 ---- (setq del-back-ch (aref del-back-ch 0))) (if (cperl-xemacs-p) ! (progn ! ;; "Active regions" are on: use region only if active ! ;; "Active regions" are off: use region unconditionally ! (defun cperl-use-region-p () ! (if zmacs-regions (mark) t)) ! (defun cperl-mark-active () (mark))) (defun cperl-use-region-p () ! (if transient-mark-mode mark-active t)) ! (defun cperl-mark-active () mark-active)) (defsubst cperl-enable-font-lock () (or (cperl-xemacs-p) window-system)) *************** *** 482,487 **** --- 558,567 ---- 'lazy-lock) "Text property which inhibits refontification.") + (defsubst cperl-put-do-not-fontify (from to) + (put-text-property (max (point-min) (1- from)) + to cperl-do-not-fontify t)) + ;;; Probably it is too late to set these guys already, but it can help later: *************** *** 525,534 **** (define-key cperl-mode-map ":" 'cperl-electric-terminator) (define-key cperl-mode-map "\C-j" 'newline-and-indent) (define-key cperl-mode-map "\C-c\C-j" 'cperl-linefeed) (define-key cperl-mode-map "\e\C-q" 'cperl-indent-exp) ; Usually not bound ;;(define-key cperl-mode-map "\M-q" 'cperl-fill-paragraph) ;;(define-key cperl-mode-map "\e;" 'cperl-indent-for-comment) ! (define-key cperl-mode-map "\177" 'backward-delete-char-untabify) (define-key cperl-mode-map "\t" 'cperl-indent-command) (if (cperl-xemacs-p) ;; don't clobber the backspace binding: --- 605,617 ---- (define-key cperl-mode-map ":" 'cperl-electric-terminator) (define-key cperl-mode-map "\C-j" 'newline-and-indent) (define-key cperl-mode-map "\C-c\C-j" 'cperl-linefeed) + (define-key cperl-mode-map "\C-c\C-a" 'cperl-toggle-auto-newline) + (define-key cperl-mode-map "\C-c\C-k" 'cperl-toggle-abbrev) + (define-key cperl-mode-map "\C-c\C-e" 'cperl-toggle-electric) (define-key cperl-mode-map "\e\C-q" 'cperl-indent-exp) ; Usually not bound ;;(define-key cperl-mode-map "\M-q" 'cperl-fill-paragraph) ;;(define-key cperl-mode-map "\e;" 'cperl-indent-for-comment) ! (define-key cperl-mode-map "\177" 'cperl-electric-backspace) (define-key cperl-mode-map "\t" 'cperl-indent-command) (if (cperl-xemacs-p) ;; don't clobber the backspace binding: *************** *** 585,605 **** "----" ("Tools" ["Imenu" imenu (fboundp 'imenu)] ["Imenu on info" cperl-imenu-on-info (featurep 'imenu)] ("Tags" ! ["Create tags for current file" cperl-etags t] ! ["Add tags for current file" (cperl-etags t) t] ! ["Create tags for Perl files in directory" (cperl-etags nil t) t] ! ["Add tags for Perl files in directory" (cperl-etags t t) t] ["Create tags for Perl files in (sub)directories" ! (cperl-etags nil 'recursive) t] ["Add tags for Perl files in (sub)directories" ! (cperl-etags t 'recursive) t]) ! ["Recalculate PODs" cperl-find-pods-heres t] ["Define word at point" imenu-go-find-at-position (fboundp 'imenu-go-find-at-position)] ["Help on function" cperl-info-on-command t] ["Help on function at point" cperl-info-on-current-command t]) ("Indent styles..." ["GNU" (cperl-set-style "GNU") t] ["C++" (cperl-set-style "C++") t] --- 668,706 ---- "----" ("Tools" ["Imenu" imenu (fboundp 'imenu)] + ["Class Hierarchy from TAGS" cperl-tags-hier-init t] + ;;["Update classes" (cperl-tags-hier-init t) tags-table-list] ["Imenu on info" cperl-imenu-on-info (featurep 'imenu)] ("Tags" ! ;;; ["Create tags for current file" cperl-etags t] ! ;;; ["Add tags for current file" (cperl-etags t) t] ! ;;; ["Create tags for Perl files in directory" (cperl-etags nil t) t] ! ;;; ["Add tags for Perl files in directory" (cperl-etags t t) t] ! ;;; ["Create tags for Perl files in (sub)directories" ! ;;; (cperl-etags nil 'recursive) t] ! ;;; ["Add tags for Perl files in (sub)directories" ! ;;; (cperl-etags t 'recursive) t]) ! ;;;; cperl-write-tags (&optional file erase recurse dir inbuffer) ! ["Create tags for current file" (cperl-write-tags nil t) t] ! ["Add tags for current file" (cperl-write-tags) t] ! ["Create tags for Perl files in directory" ! (cperl-write-tags nil t nil t) t] ! ["Add tags for Perl files in directory" ! (cperl-write-tags nil nil nil t) t] ["Create tags for Perl files in (sub)directories" ! (cperl-write-tags nil t t t) t] ["Add tags for Perl files in (sub)directories" ! (cperl-write-tags nil nil t t) t]) ! ["Recalculate PODs and HEREs" cperl-find-pods-heres t] ["Define word at point" imenu-go-find-at-position (fboundp 'imenu-go-find-at-position)] ["Help on function" cperl-info-on-command t] ["Help on function at point" cperl-info-on-current-command t]) + ("Toggle..." + ["Auto newline" cperl-toggle-auto-newline t] + ["Electric parens" cperl-toggle-electric t] + ["Electric keywords" cperl-toggle-abbrev t] + ) ("Indent styles..." ["GNU" (cperl-set-style "GNU") t] ["C++" (cperl-set-style "C++") t] *************** *** 669,676 **** \"paren\" to avoid the expansion. The processing of < is special, since most the time you mean \"less\". Cperl mode tries to guess whether you want to type pair <>, and inserts is if it ! appropriate. You can set `cperl-electric-parens' to the string that contains the parenths from the above list you want to be electrical. CPerl mode provides expansion of the Perl control constructs: if, else, elsif, unless, while, until, for, and foreach. --- 770,780 ---- \"paren\" to avoid the expansion. The processing of < is special, since most the time you mean \"less\". Cperl mode tries to guess whether you want to type pair <>, and inserts is if it ! appropriate. You can set `cperl-electric-parens-string' to the string that contains the parenths from the above list you want to be electrical. + Electricity of parenths is controlled by `cperl-electric-parens'. + You may also set `cperl-electric-parens-mark' to have electric parens + look for active mark and \"embrace\" a region if possible.' CPerl mode provides expansion of the Perl control constructs: if, else, elsif, unless, while, until, for, and foreach. *************** *** 706,719 **** Setting the variable `cperl-font-lock' to t switches on font-lock-mode, `cperl-electric-lbrace-space' to t switches on ! electric space between $ and {, `cperl-electric-parens' is the string ! that contains parentheses that should be electric in CPerl, setting ! `cperl-electric-keywords' enables electric expansion of control ! structures in CPerl. `cperl-electric-linefeed' governs which one of ! two linefeed behavior is preferable. You can enable all these options ! simultaneously (recommended mode of use) by setting `cperl-hairy' to ! t. In this case you can switch separate options off by setting them ! to `null'. If your site has perl5 documentation in info format, you can use commands \\[cperl-info-on-current-command] and \\[cperl-info-on-command] to access it. --- 810,826 ---- Setting the variable `cperl-font-lock' to t switches on font-lock-mode, `cperl-electric-lbrace-space' to t switches on ! electric space between $ and {, `cperl-electric-parens-string' is the ! string that contains parentheses that should be electric in CPerl (see ! also `cperl-electric-parens-mark' and `cperl-electric-parens'), ! setting `cperl-electric-keywords' enables electric expansion of ! control structures in CPerl. `cperl-electric-linefeed' governs which ! one of two linefeed behavior is preferable. You can enable all these ! options simultaneously (recommended mode of use) by setting ! `cperl-hairy' to t. In this case you can switch separate options off ! by setting them to `null'. Note that one may undo the extra whitespace ! inserted by semis and braces in `auto-newline'-mode by consequent ! \\[cperl-electric-backspace]. If your site has perl5 documentation in info format, you can use commands \\[cperl-info-on-current-command] and \\[cperl-info-on-command] to access it. *************** *** 732,738 **** regardless of where in the line point is when the TAB command is used. `cperl-auto-newline' Non-nil means automatically newline before and after braces, ! and after colons and semicolons, inserted in Perl code. `cperl-indent-level' Indentation of Perl statements within surrounding block. The surrounding block's indentation is the indentation --- 839,851 ---- regardless of where in the line point is when the TAB command is used. `cperl-auto-newline' Non-nil means automatically newline before and after braces, ! and after colons and semicolons, inserted in Perl code. The following ! \\[cperl-electric-backspace] will remove the inserted whitespace. ! Insertion after colons requires both this variable and ! `cperl-auto-newline-after-colon' set. ! `cperl-auto-newline-after-colon' ! Non-nil means automatically newline even after colons. ! Subject to `cperl-auto-newline' setting. `cperl-indent-level' Indentation of Perl statements within surrounding block. The surrounding block's indentation is the indentation *************** *** 825,831 **** (make-local-variable 'comment-start-skip) (setq comment-start-skip "#+ *") (make-local-variable 'defun-prompt-regexp) ! (setq defun-prompt-regexp "[ \t]*sub\\s +\\([^ \t\n{;]+\\)\\s *") (make-local-variable 'comment-indent-function) (setq comment-indent-function 'cperl-comment-indent) (make-local-variable 'parse-sexp-ignore-comments) --- 938,944 ---- (make-local-variable 'comment-start-skip) (setq comment-start-skip "#+ *") (make-local-variable 'defun-prompt-regexp) ! (setq defun-prompt-regexp "^[ \t]*sub\\s +\\([^ \t\n{;]+\\)\\s *") (make-local-variable 'comment-indent-function) (setq comment-indent-function 'cperl-comment-indent) (make-local-variable 'parse-sexp-ignore-comments) *************** *** 938,944 **** (defun cperl-electric-brace (arg &optional only-before) "Insert character and correct line's indentation. If ONLY-BEFORE and `cperl-auto-newline', will insert newline before the ! place (even in empty line), but not after." (interactive "P") (let (insertpos) (if (and (not arg) ; No args, end (of empty line or auto) --- 1051,1059 ---- (defun cperl-electric-brace (arg &optional only-before) "Insert character and correct line's indentation. If ONLY-BEFORE and `cperl-auto-newline', will insert newline before the ! place (even in empty line), but not after. If after \")\" and the inserted ! char is \"{\", insert extra newline before only if ! `cperl-extra-newline-before-brace'." (interactive "P") (let (insertpos) (if (and (not arg) ; No args, end (of empty line or auto) *************** *** 947,952 **** --- 1062,1074 ---- (save-excursion (skip-chars-backward " \t") (bolp))) + (and (eq last-command-char ?\{) ; Do not insert newline + ;; if after ")" and `cperl-extra-newline-before-brace' + ;; is nil, do not insert extra newline. + (not cperl-extra-newline-before-brace) + (save-excursion + (skip-chars-backward " \t") + (eq (preceding-char) ?\)))) (if cperl-auto-newline (progn (cperl-indent-line) (newline) t) nil))) (progn *************** *** 973,990 **** (defun cperl-electric-lbrace (arg) "Insert character, correct line's indentation, correct quoting by space." (interactive "P") ! (let (pos after (cperl-auto-newline cperl-auto-newline)) (and (cperl-val 'cperl-electric-lbrace-space) (eq (preceding-char) ?$) (save-excursion (skip-chars-backward "$") (looking-at "\\(\\$\\$\\)*\\$\\([^\\$]\\|$\\)")) (insert ? )) ! (if (cperl-after-expr-p) nil (setq cperl-auto-newline nil)) (cperl-electric-brace arg) ! (and (eq last-command-char ?{) (memq last-command-char ! (append (cperl-val 'cperl-electric-parens "" "([{<") nil)) (setq last-command-char ?} pos (point)) (progn (cperl-electric-brace arg t) (goto-char pos))))) --- 1095,1123 ---- (defun cperl-electric-lbrace (arg) "Insert character, correct line's indentation, correct quoting by space." (interactive "P") ! (let (pos after ! (cperl-auto-newline cperl-auto-newline) ! (other-end (if (and cperl-electric-parens-mark ! (cperl-mark-active) ! (> (mark) (point))) ! (save-excursion ! (goto-char (mark)) ! (point-marker)) ! nil))) (and (cperl-val 'cperl-electric-lbrace-space) (eq (preceding-char) ?$) (save-excursion (skip-chars-backward "$") (looking-at "\\(\\$\\$\\)*\\$\\([^\\$]\\|$\\)")) (insert ? )) ! (if (cperl-after-expr-p nil "{};)") nil (setq cperl-auto-newline nil)) (cperl-electric-brace arg) ! (and (cperl-val 'cperl-electric-parens) ! (eq last-command-char ?{) (memq last-command-char ! (append cperl-electric-parens-string nil)) ! (or (if other-end (goto-char (marker-position other-end))) ! t) (setq last-command-char ?} pos (point)) (progn (cperl-electric-brace arg t) (goto-char pos))))) *************** *** 992,1000 **** (defun cperl-electric-paren (arg) "Insert a matching pair of parentheses." (interactive "P") ! (let ((beg (save-excursion (beginning-of-line) (point)))) ! (if (and (memq last-command-char ! (append (cperl-val 'cperl-electric-parens "" "([{<") nil)) (>= (save-excursion (cperl-to-comment-or-eol) (point)) (point)) ;;(not (save-excursion (search-backward "#" beg t))) (if (eq last-command-char ?<) --- 1125,1141 ---- (defun cperl-electric-paren (arg) "Insert a matching pair of parentheses." (interactive "P") ! (let ((beg (save-excursion (beginning-of-line) (point))) ! (other-end (if (and cperl-electric-parens-mark ! (cperl-mark-active) ! (> (mark) (point))) ! (save-excursion ! (goto-char (mark)) ! (point-marker)) ! nil))) ! (if (and (cperl-val 'cperl-electric-parens) ! (memq last-command-char ! (append cperl-electric-parens-string nil)) (>= (save-excursion (cperl-to-comment-or-eol) (point)) (point)) ;;(not (save-excursion (search-backward "#" beg t))) (if (eq last-command-char ?<) *************** *** 1002,1007 **** --- 1143,1149 ---- 1)) (progn (insert last-command-char) + (if other-end (goto-char (marker-position other-end))) (insert (cdr (assoc last-command-char '((?{ .?}) (?[ . ?]) (?( . ?)) *************** *** 1012,1018 **** (defun cperl-electric-keyword () "Insert a construction appropriate after a keyword." ! (let ((beg (save-excursion (beginning-of-line) (point)))) (and (save-excursion (backward-sexp 1) (cperl-after-expr-p nil "{};:")) --- 1154,1161 ---- (defun cperl-electric-keyword () "Insert a construction appropriate after a keyword." ! (let ((beg (save-excursion (beginning-of-line) (point))) ! (dollar (eq (preceding-char) ?$))) (and (save-excursion (backward-sexp 1) (cperl-after-expr-p nil "{};:")) *************** *** 1024,1029 **** --- 1167,1173 ---- (save-excursion (or (not (re-search-backward "^=" nil t)) (looking-at "=cut"))) (progn + (and dollar (insert " $")) (cperl-indent-line) ;;(insert " () {\n}") (cond *************** *** 1039,1045 **** ) (or (looking-at "[ \t]\\|$") (insert " ")) (cperl-indent-line) ! (search-backward ")") (cperl-putback-char del-back-ch))))) (defun cperl-electric-else () --- 1183,1191 ---- ) (or (looking-at "[ \t]\\|$") (insert " ")) (cperl-indent-line) ! (if dollar (progn (search-backward "$") ! (forward-char 1)) ! (search-backward ")")) (cperl-putback-char del-back-ch))))) (defun cperl-electric-else () *************** *** 1081,1087 **** (pos (point)) start) (if (and ; Check if we need to split: ; i.e., on a boundary and inside "{...}" - ;;(not (search-backward "\\(^\\|[^$\\\\]\\)#" beg t)) (save-excursion (cperl-to-comment-or-eol) (>= (point) pos)) (or (save-excursion --- 1227,1232 ---- *************** *** 1093,1113 **** (save-excursion (and (eq (car (parse-partial-sexp pos end -1)) -1) ! (looking-at "[ \t]*\\($\\|#\\)") ! ;;(setq finish (point-marker)) (progn (backward-sexp 1) (setq start (point-marker)) ! (<= start pos)) ! ;;(looking-at "[^{}\n]*}[ \t]*$") ; Will fail if there are intervening {}'s ! ;;(search-backward "{" beg t) ! ;;(looking-at "{[^{}\n]*}[ \t]*$") ! ))) ! ;;(or (looking-at "[ \t]*}") ; and on a boundary of statements ! ;; (save-excursion ! ;; (skip-chars-backward " \t") ! ;; (forward-char -1) ! ;; (looking-at "[{;]")))) (progn (skip-chars-backward " \t") (or (memq (preceding-char) (append ";{" nil)) --- 1238,1248 ---- (save-excursion (and (eq (car (parse-partial-sexp pos end -1)) -1) ! (looking-at "[,; \t]*\\($\\|#\\)") ; Comma to allow anon subr (progn (backward-sexp 1) (setq start (point-marker)) ! (<= start pos))))) (progn (skip-chars-backward " \t") (or (memq (preceding-char) (append ";{" nil)) *************** *** 1115,1122 **** (insert "\n") (forward-line -1) (cperl-indent-line) - ;;(end-of-line) - ;;(search-backward "{" beg) (goto-char start) (or (looking-at "{[ \t]*$") ; If there is a statement ; before, move it to separate line --- 1250,1255 ---- *************** *** 1127,1133 **** (forward-line 1) ; We are on the target line (cperl-indent-line) (beginning-of-line) ! (or (looking-at "[ \t]*}[ \t]*$") ; If there is a statement ; after, move it to separate line (progn (end-of-line) --- 1260,1266 ---- (forward-line 1) ; We are on the target line (cperl-indent-line) (beginning-of-line) ! (or (looking-at "[ \t]*}[,; \t]*$") ; If there is a statement ; after, move it to separate line (progn (end-of-line) *************** *** 1157,1163 **** (defun cperl-electric-terminator (arg) "Insert character and correct line's indentation." (interactive "P") ! (let (insertpos (end (point))) (if (and (not arg) (eolp) (not (save-excursion (beginning-of-line) --- 1290,1299 ---- (defun cperl-electric-terminator (arg) "Insert character and correct line's indentation." (interactive "P") ! (let (insertpos (end (point)) ! (auto (and cperl-auto-newline ! (or (not (eq last-command-char ?:)) ! cperl-auto-newline-after-colon)))) (if (and (not arg) (eolp) (not (save-excursion (beginning-of-line) *************** *** 1180,1205 **** (let ((pps (parse-partial-sexp (point) end)))