summaryrefslogtreecommitdiff
path: root/x2p/a2p.y
Commit message (Collapse)AuthorAgeFilesLines
* misc a2p fixesBrendan O'Dea2005-09-211-10/+37
| | | | | | | Message-ID: <20050911094314.GA15155@londo.c47.org> and remove the check_byacc target from the x2p makefile p4raw-id: //depot/perl@25534
* Fix up Larry's copyright statements to my best knowledge.Jarkko Hietaniemi2003-04-161-1/+2
| | | | | | | (Lots of Perl 5 source code archaeology was involved.) Larry didn't make strangled noises when I showed him the patch, either :-) p4raw-id: //depot/perl@19242
* Reverse copyright update (#18801) for files not changed in 2003.Hugo van der Sanden2003-03-021-1/+1
| | | p4raw-id: //depot/perl@18807
* Update all copyrights to 2003, from JarkkoHugo van der Sanden2003-03-021-1/+1
| | | p4raw-id: //depot/perl@18801
* Copyright++. (Not all the toplevel *.h have one, it seems.)Jarkko Hietaniemi2002-01-231-1/+1
| | | p4raw-id: //depot/perl@14391
* Bump up Larry's copyright.Jarkko Hietaniemi2001-01-011-1/+1
| | | p4raw-id: //depot/perl@8289
* remove _() non-ansismGurusamy Sarathy1999-06-021-1/+1
| | | p4raw-id: //depot/perl@3518
* ] a2p: make sprintf less greedy without -oAlbert Dvornik1998-10-311-2/+7
| | | | | Message-Id: <tqd879vf4z.fsf@puma.genscan.com> p4raw-id: //depot/perl@2161
* [inseparable changes from match from perl-5.003_91 to perl-5.003_92]Perl 5 Porters1997-03-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | CORE LANGUAGE CHANGES Subject: Strictly follow lexical context of C<eval ''> and nested subs From: Chip Salzenberg <chip@perl.com> Files: op.c Subject: Make ::SUPER and UNIVERSAL work together From: Chip Salzenberg <chip@perl.com> Files: gv.c pod/perlguts.pod CORE PORTABILITY Subject: OS/2 patches Date: Wed, 5 Mar 1997 22:08:43 -0500 (EST) From: Ilya Zakharevich <ilya@math.ohio-state.edu> Files: hints/os2.sh lib/ExtUtils/MakeMaker.pm t/op/taint.t Msg-ID: 199703060308.WAA22211@monk.mps.ohio-state.edu (applied based on p5p patch as commit eda4d5189d403b15f244b4696a710fb91d15053e) Subject: VMS patches Date: Wed, 05 Mar 1997 23:10:24 -0500 (EST) From: Charles Bailey <bailey@HMIVAX.HUMGEN.UPENN.EDU> Files: lib/ExtUtils/MM_VMS.pm lib/ExtUtils/Manifest.pm perlsdio.h t/op/runlevel.t t/op/taint.t vms/descrip.mms vms/perly_c.vms vms/sockadapt.c vms/sockadapt.h vms/vms_yfix.pl private-msgid: 01IG5SQE4A6U00661G@hmivax.humgen.upenn.edu DOCUMENTATION Subject: Add taint checks and srand to perldelta Date: Sun, 2 Mar 1997 11:56:08 -0800 (PST) From: Tom Phoenix <rootbeer@teleport.com> Files: pod/perldelta.pod Msg-ID: Pine.GSO.3.95q.970302115355.23058D-100000@kelly.teleport.com (applied based on p5p patch as commit b28e0bc0aa3232e18d1bacb3efcbfb755ad100e0) Subject: Don't call FileHandle 'deprecated' From: Chip Salzenberg <chip@perl.com> Files: pod/perldelta.pod Subject: Improve sample module header Date: Sat, 01 Mar 1997 10:32:31 -0700 From: Tom Christiansen <tchrist@jhereg.perl.com> Files: pod/perlmod.pod Msg-ID: 199703011732.KAA14693@jhereg.perl.com (applied based on p5p patch as commit 3e1e15658152387f41e00ded4796cede4e1e10d3) Subject: Update list of CPAN sites Date: Sun, 2 Mar 1997 16:54:22 +0200 (EET) From: Jarkko Hietaniemi <jhi@iki.fi> Files: pod/perlmod.pod Msg-ID: 199703021454.QAA07446@alpha.hut.fi (applied based on p5p patch as commit 9423903e60e6c92c1893f5f4cab2476f403f8a4b) Subject: Enhance description of 'server error' Date: Tue, 4 Feb 1997 21:03:23 +0200 (EET) From: Jarkko Hietaniemi <jhi@cc.hut.fi> Files: pod/perldiag.pod private-msgid: 199702041903.VAA16070@alpha.hut.fi Subject: Regularize format of E-Mail addresses in *.pod From: Chip Salzenberg <chip@perl.com> Files: pod/*.pod LIBRARY AND EXTENSIONS Subject: Use IV instead of double for tms structure members From: Chip Salzenberg <chip@perl.com> Files: ext/POSIX/POSIX.xs OTHER CORE CHANGES Subject: Make sure $^X is tainted when ARG_ZERO_IS_SCRIPT From: Chip Salzenberg <chip@perl.com> Files: toke.c Subject: Clarify '-T too late' error From: Chip Salzenberg <chip@perl.com> Files: perl.c pod/perldiag.pod Subject: Warn when redefining or undefining a constant sub From: Chip Salzenberg <chip@perl.com> Files: pod/perldiag.pod pp.c sv.c Subject: Don't generate spurious 'not imported' warning From: Chip Salzenberg <chip@perl.com> Files: gv.c t/pragma/strict-vars pod/perldiag.pod Subject: Clarify message re: @host in string From: Chip Salzenberg <chip@perl.com> Files: pod/perldiag.pod pod/perltrap.pod toke.c Subject: Disconnect refs that are targets of pp_readline From: Chip Salzenberg <chip@perl.com> Files: pp_hot.c Subject: Fix typo in test of HvFILL() From: Chip Salzenberg <chip@perl.com> Files: op.c Subject: Allow for pad name array to be shorter than pad array From: Chip Salzenberg <chip@perl.com> Files: op.c Subject: Eliminate format-string type warnings Date: Mon, 3 Mar 1997 10:15:11 +0100 (MET) From: Hallvard B Furuseth <h.b.furuseth@usit.uio.no> Files: doio.c ext/POSIX/POSIX.xs gv.c hints/dec_osf.sh pp.c pp_ctl.c pp_hot.c run.c sv.c x2p/a2py.c private-msgid: 199703030915.KAA11634@bombur2.uio.no Subject: Update copyright dates From: Chip Salzenberg <chip@perl.com> Files: *.[hc] x2p/*.[hc] win32/EXTERN.h vms/vmsish.h vms/vms.c TESTS Subject: Smarter t/op/taint.t Date: Mon, 3 Mar 1997 10:31:54 -0800 (PST) From: Tom Phoenix <rootbeer@teleport.com> Files: t/op/taint.t private-msgid: Pine.GSO.3.95q.970303103047.24000A-100000@kelly.teleport.com Subject: Fix taint test for systems without csh From: Chip Salzenberg <chip@perl.com> Files: t/op/taint.t
* [inseparable changes from patch from perl5.003_26 to perl5.003_27]Perl 5 Porters1997-02-181-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | BUILD PROCESS Subject: Fix eval "" in Configure Date: Fri, 14 Feb 1997 13:09:53 -0500 From: John L. Allen <allen@gateway.grumman.com> Files: Configure Subject: Re: Configure problem on IRIX - me dumb p5p-msgid: <9702141809.AA17001@gateway.grumman.com> Subject: Don't link with -lsfio if sfio is not requested From: Chip Salzenberg <chip@perl.com> Files: Configure Subject: perl5.003_26 Configure change "win" for AIX 4 Date: Fri, 14 Feb 1997 13:59:02 -0600 (CST) From: Tim Mooney <mooney@dogbert.cc.ndsu.NoDak.edu> Files: Configure p5p-msgid: <Pine.OSF.3.95.970214135751.32654A-100000@dogbert.cc.ndsu.NoDak.edu> private-msgid: <Pine.OSF.3.95.970214135751.32654A-100000@dogbert.cc.ndsu.NoD CORE LANGUAGE CHANGES Subject: Better looks_like_number() function [sv.c] Date: Fri, 14 Feb 1997 18:08:52 +0100 From: Gisle Aas <aas@bergen.sn.no> Files: sv.c Msg-ID: <199702141708.SAA17546@bergen.sn.no> (applied based on p5p patch as commit 8dbaa58ee2aba7cc22d84199a674c58bbf108b46) Subject: Remove redundant functions UNIVERSAL::{class,is_instance} Date: 14 Feb 1997 15:52:21 +0000 From: Gisle Aas <aas@bergen.sn.no> Files: pod/perldelta.pod pod/perlobj.pod t/op/universal.t universal.c Msg-ID: <hwwsbpeq2.fsf@bergen.sn.no> (applied based on p5p patch as commit 77bb9b23081b62119e8fbe9f5655b8802e4537ae) Subject: Allow C<setpgrp $$> Date: 16 Feb 1997 23:19:12 -0500 From: Roderick Schertler <roderick@gate.net> Files: pp_sys.c Msg-ID: <pzraigyshr.fsf@eeyore.ibcinc.com> (applied based on p5p patch as commit 3d2573a84a1aa655d5da58c57b3fc20e04d40f9f) Subject: Fix syntax error on C<&$1> From: Chip Salzenberg <chip@perl.com> Files: toke.c Subject: Fix grep() with refs in array context From: Chip Salzenberg <chip@perl.com> Files: pp.c CORE PORTABILITY Subject: Eliminate $^S; add C<use vmsish qw(status exit time)> Date: Mon, 17 Feb 1997 02:45:26 -0500 (EST) From: Charles Bailey <bailey@HMIVAX.HUMGEN.UPENN.EDU> Files: MANIFEST gv.c lib/English.pm lib/ExtUtils/MM_VMS.pm lib/ExtUtils/Mksymlists.pm lib/ExtUtils/xsubpp mg.c op.c perl.c perl.h pod/perldelta.pod pod/perlmod.pod pod/perlvar.pod pp_ctl.c pp_sys.c utils/perldoc.PL vms/Makefile vms/config.vms vms/descrip.mms vms/ext/Stdio/Stdio.pm vms/ext/Stdio/Stdio.xs vms/ext/XSSymSet.pm vms/ext/vmsish.pm vms/vms.c vms/vmsish.h win32/makedef.pl private-msgid: <01IFI9CFKL0S004R2V@hmivax.humgen.upenn.edu> LIBRARY AND EXTENSIONS Subject: Remove Fatal.pm From: Chip Salzenberg <chip@perl.com> Files: MANIFEST lib/Fatal.pm pod/perldelta.pod pod/perlmod.pod pod/roffitall t/lib/fatal.t Subject: Refresh MakeMaker to 5.40 From: Andy Dougherty <doughera@lafcol.lafayette.edu> Files: lib/ExtUtils/Liblist.pm lib/ExtUtils/MM_Unix.pm lib/ExtUtils/MakeMaker.pm lib/ExtUtils/Mksymlists.pm OTHER CORE CHANGES Subject: Fix core dump when embedding From: Chip Salzenberg <chip@perl.com> Files: perl.c Subject: Re: Fragile signals Date: Thu, 13 Feb 1997 01:44:39 -0500 (EST) From: Ilya Zakharevich <ilya@math.ohio-state.edu> Files: mg.c Msg-ID: <199702130644.BAA07572@monk.mps.ohio-state.edu> (applied based on p5p patch as commit 09df8c7df7dfc9853902f1fdd8a6d95f53be66fc) Subject: Make format strings correspond exactly to parameters Date: 13 Feb 1997 17:24:31 -0500 From: Roderick Schertler <roderick@gate.net> Files: doio.c ext/DB_File/DB_File.xs ext/Opcode/Opcode.xs gv.c op.c perl.c pp_ctl.c pp_sys.c regcomp.c toke.c Msg-ID: <pz7mkc1h0g.fsf@eeyore.ibcinc.com> (applied based on p5p patch as commit bf81aadd817bdea29720b072eef945df2da8463b) Subject: Don't try to attach 'o' magic to read-only values From: Chip Salzenberg <chip@perl.com> Files: sv.c Subject: Fix carriage-return message From: Chip Salzenberg <chip@perl.com> Files: toke.c Subject: In <=>, test for equality first From: Chip Salzenberg <chip@perl.com> Files: pp.c Subject: Don't mark sv_{true,false} PADTMP From: Chip Salzenberg <chip@perl.com> Files: op.c
* Fix a2p translation of '{print "a" "b" "c"}'Chip Salzenberg1996-11-191-2/+2
|
* perl 5.000perl-5.000Larry Wall1994-10-171-11/+0
| | | | | | | | | | | [editor's note: this commit combines approximate 4 months of furious releases of Andy Dougherty and Larry Wall - see pod/perlhist.pod for details. Andy notes that; Alas neither my "Irwin AccuTrack" nor my DC 600A quarter-inch cartridge backup tapes from that era seem to be readable anymore. I guess 13 years exceeds the shelf life for that backup technology :-(. ]
* perl 5.0 alpha 8Andy Dougherty1994-04-041-1/+3
| | | | | [the last one taken from the September '94 InfoMagic CD; a similar style of cleanup as the previous commits was performed]
* perl 5.0 alpha 4Larry Wall1993-11-101-1/+1
| | | | | | | [editor's note: the sparc executables have not been included, and emacs backup files have been removed. This was reconstructed from a tarball found on the September 1994 InfoMagic CD; the date of this is approximate]
* perl 5.0 alpha 2perl-5a2Larry Wall1993-10-071-1/+3
| | | | [editor's note: from history.perl.org. The sparc executables originally included in the distribution are not in this commit.]
* perl 4.0 patch 21: patch #20, continuedLarry Wall1992-06-081-4/+7
| | | | See patch #20.
* perl 4.0 patch 5: patch #4, continuedLarry Wall1991-06-061-4/+7
| | | | See patch #4.
* perl 4.0.00: (no release announcement available)perl-4.0.00Larry Wall1991-03-211-13/+3
| | | | So far, 4.0 is still a beta test version. For the last production version, look in pub/perl.3.0/kits@44.
* perl 3.0 patch #42 (combined patch)Larry Wall1991-01-111-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Most of these patches are pretty self-explanatory. Much of this is random cleanup in preparation for version 4.0, so I won't talk about it here. A couple of things should be noted, however. First, there's a new -0 option that allows you to specify (in octal) the initial value of $/, the record separator. It's primarily intended for use with versions of find that support -print0 to delimit filenames with nulls, but it's more general than that: null ^A default CR paragraph mode file slurp mode This feature is so new that it didn't even make it into the book. The other major item is that different patchlevels of perl can now coexist in your bin directory. The names "perl" and "taintperl" are just links to "perl3.044" and "tperl3.044". This has several benefits. The perl3.044 invokes the corresponding tperl3.044 rather than taintperl, so it always runs the correct version. Second, you can "freeze" a script by putting a #! line referring to a version that it is known to work with. Third, you can put a new version out there to try out before making it the default perl. Lastly, it sells more disk drives. :-) Barring catastrophe, this will likely be the last patch before version 4.0 comes out.
* perl 3.0 patch #20 patch #19, continuedLarry Wall1990-08-081-3/+6
| | | | See patch #19.
* perl 3.0 patch #9 (combined patch)Larry Wall1990-02-281-20/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Well, I didn't quite fix 100 things--only 94. There are still some other things to do, so don't think if I didn't fix your favorite bug that your bug report is in the bit bucket. (It may be, but don't think it. :-) There are very few enhancements here. One is the new pipe() function. There was just no way to emulate this using the current operations, unless you happened to have socketpair() on your system. Not even syscall() was useful in this respect. Configure now determines whether volatile is supported, since some compilers implement volatile but don't define __STDC__. Some compilers can put structure members and global variables into registers, so more variables had to be declared volatile to avoid clobbering during longjmp(). Some systems have wanted routines stashed away in libBSD.a and libPW.a. Configure can now find them. A number of Configure tests create a file called "try" and then execute it. Unfortunately, if there was a "try" elsewhere in PATH it got that one instead. All references are now to "./try". On Ultrix machines running the Mips cpu, some header files define things differently for assembly language than for the C language. To differentiate these, cc passes a -DLANGUAGE_C to the C preprocessor. Unfortunately, Configure, makedepend and perl want to use the preprocessor independently of cc. Configure now defaults to adding -DLANGUAGE_C on machines containing that symbol in signal.h. In Configure, some libraries were getting into the list more than once, causing extra extraction overhead. The names are now uniquified. Someone has invented yet another output format for nm. Sigh. Why do people assume that only people read the output of programs? Due to commentary between a declaration and its semicolon, some standard versions of stdio weren't being considered standard, and the type of char used by stdio was being misidentified. People trying to use bison instead of yacc ran into two problems. One, lack of alloca(), is solved on some machines by finding libPW.a. The other is that you have to supply a -y switch to bison to get it to emulate yacc naming conventions. Configure now prompts correctly for bison -y. The make clean had a rm -f $suidperl where it just wanted a rm -f suidperl In the README, documented more weirdities on various machines, including a pointer to the JMPCLOBBER symbol. In the construct OUTER: foreach (1,2,3) { INNER: foreach (4,5) { ... next OUTER; } } the inner loop was not getting reset to the first element. This was one of those bugs that arise because longjmp() doesn't execute exit handlers as it unwinds the stack. Perl reallocs many things as they grow, including the stack (its stack, not the C program's stack). This means that routines have to be careful to retreive the new stack when they call subroutines that can do such a realloc. In cmd.c there was such code but it was hidden inside an #ifdef JMPCLOBBER that it should have been outside of, so you could get bad return values of JMPCLOBBER wasn't defined. If you defined JMPCLOBBER to work around this problem, you should consider undefining it if your compiler guarantees that register variables get the value they had either at setjmp() or longjmp() time. Perl runs slightly faster without JMPCLOBBER defined. The longjmp()s that perl does return known values, but as a paranoid programming measure, it now checks that the values are one of the expected ones. If you say something like while (s/ /_/) {} the substitution almost always succeeds (on normal text). There is an optimization that quickly discovers and bypasses operations that are going to fail, but does nothing to help generally successful ones such as the one above. So there's a heuristic that disables the optimization if it isn't buying us anything. Unfortunately, in the above case, it's in the conditional of a while loop, which is duplicated by another optimization to be a last unless s/ /_/; at the end of the loop, to avoid unnecessary subroutine calls. Because the conditional was duplicated (not the expression itself, just the structure pointing to it), the heuristic mentioned above tried to disable the first optimization twice, resulting in the label stack getting corrupted. Some subroutines which mix both return mechanisms like this: sub foo { local($foo); return $foo if $whatever; $foo; } This clobbered the return value of $foo when the end of the scope of the local($foo) was reached. This was because such a routine turns into something like this internally: sub foo { _SUB_: { local($foo); if ($whatever) { $foo; last _SUB_; } $foo; } } Because the outer _SUB_ block was manufactured by non-standard means, it wasn't getting marked as an expression that could return a value, ie a terminal expression. So the return value wasn't getting properly saved off to the side before the local() exited. The internal label on subroutine blocks used to be SUB, but I changed it to _SUB_ to avoid possible confusion. Evals now have labels too, so they are labelled with _EVAL_. The reason evals now have a label is that nested evals need separate longjmp environments, or fatal errors end up getting a longjmp() botch. So eval now uses the same label stack as loops and subroutines. The eval routine used to always return undef on failure. In an array context, however, this makes a non-null array, which when assigned is TRUE, which is counter-intuitive. It now returns a null array upon failure in an array context. When a foreach operator works on a non-array, the compiler translates foreach (1,2,3) { into something like @_GEN_0 = (1,2,3); foreach (@_GEN_0) { Unfortunately, the line number was not correctly propagated to both command structures, so huge line numbers could appear in error messages and while debugging. The x operator was stupidly written, just calling the internal routine str_scat() multiple times, and not preextending the string to the known new length. It now preextends the string and calls a special routine to replicate the string quickly. On long strings like '\0' x 1024, the operator is more than 10 times faster. The split operator is supposed to split into @_ if called in a scalar context. Unfortunately, it was also splitting into @_ in an array context that wasn't a real array, such as assignment to a list: ($foo,$bar) = split; This has now been fixed. The split and substitute operators have a check to make sure that it isn't looping endlessly. Unfortunate, they had a hardwired limit of 10000 iterations. There are applications conceivable where you could work on longer values than that, so they now calculate a reasonable limit based on the length of the arguments. Pack and unpack called atoi all the time on the template fields. Since there are usually at most one or two digits of number, this wasted a lot of time on machines with slow subroutine calls. It now picks up the number itself. There were several places that casts could blow up. In particular, it appears that a sun3 can't cast a negative float to an unsigned integer. Appropriate measure have been taken--hopefully this won't blow someone else up. A local($.) didn't work right because the actual value of the current line number is derived from the last input filehandle. This has been fixed by causing the last input filehandle to be restored after the scope of a local($.) to what it was when the local was executed. Assignment is supposed to return the final value of the left hand side. In the case of array assignment (in an array context), it was actually returning the right hand side. This showed up in things that referred to the actual elements of an array value, such as grep(s/foo/bar/, @abc = @xyz), which modified @xyz rather than @abc. The syscall() function was returning a garbage value (the index of the top of the stack, actually) rather than value of system call. There was some discussion about how to open files with arbitrary characters in the filename. In particular, the open function strips trailing spaces. There was no way to suppress this. Now you can put an explicit null at the end of the string open(FOO,"$filename\0") and this will hide any spaces on the end of the filename. The Unix open() function will of course treat the null as the trailing delimiter. As a hangover from when Perl was not useful on binary files, there was a check to make sure that the file being opened was a normal file or character special file or socket. Now that Perl can handle binary data, this is useless, and has been removed. Some versions of utime.h have microseconds specified as acusec and modusec. Perl was referring to these in order to zero out the fields. But not everyone has these. Perl now just bzero's out the structure and refers only to fields that everyone has. You used to have to say ($foo) = unpack("L",$bar); Now you can say $foo = unpack("L",$bar); and it will just unpack the first thing specified by the template; The subscripts for slices were ignoring the value of $[. (This never made any difference for people who leave $[ set to 0.) It seems reasonable that grep in a scalar context should return the number of items matched so that it can be used in, say, a conditional. Formerly it returned an undef. Another problem with grep was that if you said something like grep(/$1/, @foo) then each iteration of grep was executing in the context of the previous iteration's regexp, so $1 might be wiped out after the first iteration. All iterations of grep now operate in the regexp context of the grep operator itself. The eg/README file now explicity states that the examples in the eg directory are to be considered in the Public Domain, and thus do not have the same restrictions as the Perl source. In a previous patch the shift operator was made to shift @_ inside of subroutines. This made some of the getopt code wrong. The sample rename command (and the new relink command) can either take a list of filenames from stdin, or if stdin is a terminal, default to a * in the current directory. A sample travesty program is now included. If you want to know what it does, feed it about 10 Usenet articles, or the perl manual, and see what it prints out. If a return operator was embedded in an expression that supplied a scalar context, but the subroutine containing the return was called in an array context, an array was not returned correctly. Now it is. The !~ operator used to ignore the negation in an array context and do the same thing as =~. It now always returns scalar even in array context, so if you say ($foo) = ($bar !~ /(pat)/) $foo will get a value of either 1 or ''. Opens on pipes were defined to return the child's pid in the parent, and FALSE in the child. Unfortunately, what the child actually got was an undef, making it indistinguishable from a failure to open the pipe successfully. The child now gets a 0, and undef means a failure to fork a child. Formerly, @array in a scalar context returned the last value of the array, by analogy to the comma operator. This makes for counter-intuitive results when you say if (@array) if 0 or '' is a legal array value. @array now returns the length of the array (not the subscript of the last element, which is @#array). To get the last element of the array you must either pop(@array) or refer to $array[$#array]. The chdir operator with no argument was supposed to change directory to your home directory, but it core dumped instead. The wait operator was ignoring SIGINT and SIGQUIT, by analogy to the system and pipe operations. But wait is a lower level operation, and it gives you more freedom if those signals aren't automatically ignored. If you want them ignored, you now have to explicitly ignore them by setting the proper %SIG entry. Different versions of /bin/mkdir and /bin/rmdir return different messages upon failure. Perl now knows about more of them. -l FILEHANDLE now disallowed The use of the -l file test makes no sense on a filehandle, since you can't open symbolic links. So -l FILEHANDLE now is a fatal error. This also means you can't say -l _, which is also a useless operation. The heavy wizardry involved in saying $#foo -= 2 didn't work quite right. In formats, you can say ... in a ^ field to have ... output when there is more for that field that is getting truncated. The next field was getting shifted over by three characters, however. The perl library routines abbrev.pl, complete.pl, getopt.pl and getopts.pl were assuming $[ == 0. The Getopt routine wasn't returning an error on unrecognized switches. The look.pl routine had never been tested, and didn't work at all. Now it does. There were several difficulties in termcap.pl. Togoto was documented backwards for $rows and $cols. The Tgetent routine could loop endlessly if there was a tc entry. And it didn't interpret the ^x form of specifying control characters right because of base treachery (031 instead of 31). There were also problems with using @_ as a temporary array. In perl.h, the unused VREG symbol was deleted because it conflicted with somebody's header files. If perl detects a #! line that specifies some other interpreter than perl, it will now start up that interpreter for you. This let's you specify a SHELL of perl to some programs. The $/ variable specifies the input record separator. It was possible to set it to a non-text character and read in an entire text file as one input, but it wasn't possible to do that for a binary file. Now you can undef $/, and there will be no record separator, so you are guaranteed to get the entire file with one <>. The example in the manual of an open() inside a ?: had the branches of the ?: backwards. I documented the fact that grep can modify arrays in place (with caveats about modifying literal values). I also put in how to deal with filenames that might have arbitrary characters, and mentioned about the problem of unflushed buffers on opens that cause forks. It's now documented how to force top of page before the next write. Formerly, $0 was guaranteed to contain the name of the perl script only till the first regular expression was executed. It now keeps that value permanently. $0 can no longer be used as a synonym for $&. The regular expression evaluator didn't handle character classes with the 8th bit set. None of /[\200-\377]/, \d, \w or \s worked right--the character class because signed characters were not interpreted right, and the builtins because the isdigit(), isalpha() and isspace() macros are only defined if isascii() is true. Patterns of the form /\bfoo/i didn't work right because the \b wants to compare the preceding character with the next one to look for word boundaries, and the i modifier forced a move of the string to a place where it couldn't do that without examining malloc garbage. The type glob syntax *foo produces the symbol table entry for all the various foo variables. Perl has to do certain bookkeeping when moving such values around. The symbol table entry was not adequately differentiated from normal data to prevent occasion confusion, however. On MICROPORTs, the CRIPPLED_CC option made the stab_array() and stab_hash() macros into function calls, but neglected to supply the function definitions. The string length allocated to turn a number into a string internally turned out to be too short on a Sun 4. Several constructs were not recognized properly inside double-quoted strings: underline in name required @foo to be defined rather than %foo threw off bracket matcher not identified with $1 The base.term test gives misleading results if /dev/null happens not to be a character special file. So it now checks for that. The op.stat could exceed the shell's maximum argument length when evaluating </usr/bin/*>. It now chdirs to /usr/bin and does <*>. return grandfathered to never be function call The construct return (1,2,3); did not do what was expected, since return was swallowing the parens in order to consider itself a function. The solution, since return never wants any trailing expression such as return (1,2,3) + 2; is to simply make return an exception to the paren-makes-a-function rule, and treat it the way it always was, so that it doesn't strip the parens. If perldb.pl doesn't exist, there was no reasonable error message given when you invoke perl -d. It now does a do-or-die internally. null hereis core dumped The hereis construct dumped core on a null string: print <<'FOO'; FOO Certain pattern matches weren't working on patterns with embedded nulls because the fbminstr() routine, when it decided it couldn't do a fancy search, degenerated to using instr(), rather than ninstr(), which is better about embedded nulls. The s2p sed-to-perl translator didn't translate \< and \> to \b. Now it does. The a2p awk-to-perl translator didn't put a $ on ExitValue when translating the awk exit construct. It also didn't allow logical expressions inside normal expressions: i = ($1 == 2 || $2 ~ /bar/) a2p.h had definition of a bzero() macro inside an ifdef of BCOPY. The two don't always go together, and since Configure is already looking for both separately...
* perl 3.0: (no announcement message available)perl-3.000Larry Wall1989-10-181-54/+129
| | | | | | | | | | | | | | A few of the new features: (18 Oct) * Perl can now handle binary data correctly and has functions to pack and unpack binary structures into arrays or lists. You can now do arbitrary ioctl functions. * You can now pass things to subroutines by reference. * Debugger enhancements. * An array or associative array may now appear in a local() list. * Array values may now be interpolated into strings. * Subroutine names are now distinguished by prefixing with &. You can call subroutines without using do, and without passing any argument list at all. * You can use the new -u switch to cause perl to dump core so that you can run undump and produce a binary executable image. Alternately you can use the "dump" operator after initializing any variables and such. * You can now chop lists. * Perl now uses /bin/csh to do filename globbing, if available. This means that filenames with spaces or other strangenesses work right. * New functions: mkdir and rmdir, getppid, getpgrp and setpgrp, getpriority and setpriority, chroot, ioctl and fcntl, flock, readlink, lstat, rindex, pack and unpack, read, warn, dbmopen and dbmclose, dump, reverse, defined, undef.
* perl 2.0 (no announcement message available)perl-2.0Larry Wall1988-06-051-36/+47
| | | | | | | | | | | | | | | | | | | | | | | | Some of the enhancements from Perl1 included: * New regexp routines derived from Henry Spencer's. o Support for /(foo|bar)/. o Support for /(foo)*/ and /(foo)+/. o \s for whitespace, \S for non-, \d for digit, \D nondigit * Local variables in blocks, subroutines and evals. * Recursive subroutine calls are now supported. * Array values may now be interpolated into lists: unlink 'foo', 'bar', @trashcan, 'tmp'; * File globbing. * Use of <> in array contexts returns the whole file or glob list. * New iterator for normal arrays, foreach, that allows both read and write. * Ability to open pipe to a forked off script for secure pipes in setuid scripts. * File inclusion via do 'foo.pl'; * More file tests, including -t to see if, for instance, stdin is a terminal. File tests now behave in a more correct manner. You can do file tests on filehandles as well as filenames. The special filetests -T and -B test a file to see if it's text or binary. * An eof can now be used on each file of the <> input for such purposes as resetting the line numbers or appending to each file of an inplace edit. * Assignments can now function as lvalues, so you can say things like ($HOST = $host) =~ tr/a-z/A-Z/; ($obj = $src) =~ s/\.c$/.o/; * You can now do certain file operations with a variable which holds the name of a filehandle, e.g. open(++$incl,$includefilename); $foo = <$incl>; * Warnings are now available (with -w) on use of uninitialized variables and on identifiers that are mentioned only once, and on reference to various undefined things. * There is now a wait operator. * There is now a sort operator. * The manual is now not lying when it says that perl is generally faster than sed. I hope.
* a "replacement" for awk and sedperl-1.0Larry Wall1987-12-181-0/+325
[ Perl is kind of designed to make awk and sed semi-obsolete. This posting will include the first 10 patches after the main source. The following description is lifted from Larry's manpage. --r$ ] Perl is a interpreted language optimized for scanning arbitrary text files, extracting information from those text files, and printing reports based on that information. It's also a good language for many system management tasks. The language is intended to be practical (easy to use, efficient, complete) rather than beautiful (tiny, elegant, minimal). It combines (in the author's opinion, anyway) some of the best features of C, sed, awk, and sh, so people familiar with those languages should have little difficulty with it. (Language historians will also note some vestiges of csh, Pascal, and even BASIC-PLUS.) Expression syntax corresponds quite closely to C expression syntax. If you have a problem that would ordinarily use sed or awk or sh, but it exceeds their capabilities or must run a little faster, and you don't want to write the silly thing in C, then perl may be for you. There are also translators to turn your sed and awk scripts into perl scripts.