summaryrefslogtreecommitdiff
path: root/x2p/walk.c
Commit message (Collapse)AuthorAgeFilesLines
* Omnibus removal of register declarationsKarl Williamson2012-08-181-13/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This removes most register declarations in C code (and accompanying documentation) in the Perl core. Retained are those in the ext directory, Configure, and those that are associated with assembly language. See: http://stackoverflow.com/questions/314994/whats-a-good-example-of-register-variable-usage-in-c which says, in part: There is no good example of register usage when using modern compilers (read: last 10+ years) because it almost never does any good and can do some bad. When you use register, you are telling the compiler "I know how to optimize my code better than you do" which is almost never the case. One of three things can happen when you use register: The compiler ignores it, this is most likely. In this case the only harm is that you cannot take the address of the variable in the code. The compiler honors your request and as a result the code runs slower. The compiler honors your request and the code runs faster, this is the least likely scenario. Even if one compiler produces better code when you use register, there is no reason to believe another will do the same. If you have some critical code that the compiler is not optimizing well enough your best bet is probably to use assembler for that part anyway but of course do the appropriate profiling to verify the generated code is really a problem first.
* walk.c: Combine macro callsKarl Williamson2012-06-171-5/+5
| | | | | Replace combinations of macro calls with single ones that mean the same thing.
* a2p match() faultyZefram2009-10-231-1/+1
| | | | | | | While I was doing the $[ thing, I discovered a bug in a2p's handling of the match() operator. It uses a comma operator, which has unintended behaviour in list context (e.g., in a print statement). It also returns empty string for a non-match, rather than the required 0.
* [perl #69838] a2p generates code using $[Zefram2009-10-231-15/+11
|
* Backslash-escape /s in the target of a generated s/// expressionAbhijit Menon-Sen2009-08-291-1/+1
| | | | | Fixes #68840 reported by Guglielmo Bondioni, where a2p incorrectly translated sub(/foo/,"bar/baz") into s/foo/bar/baz/.
* Remove Nullch etc. from x2pJan Dubois2007-12-251-4/+4
| | | | | | From: "Jan Dubois" <jand@activestate.com> Message-ID: <0cca01c84680$7afc9170$70f5b450$@com> p4raw-id: //depot/perl@32721
* C<make translators> -Wwrite-strings cleanRobin Barker2007-12-211-20/+25
| | | | | | From: "Robin Barker" <Robin.Barker@npl.co.uk> Message-ID: <46A0F33545E63740BC7563DE59CA9C6D09399C@exchsvr2.npl.ad.local> p4raw-id: //depot/perl@32690
* Cleaning up x2p directoryAndy Lester2005-11-071-8/+1
| | | | | Message-ID: <20051104211355.GB12651@petdance.com> p4raw-id: //depot/perl@26033
* misc a2p fixesBrendan O'Dea2005-09-211-7/+5
| | | | | | | Message-ID: <20050911094314.GA15155@londo.c47.org> and remove the check_byacc target from the x2p makefile p4raw-id: //depot/perl@25534
* Add casting to allow g++ (3.3.5) to compile the core code.Nicholas Clark2005-04-051-3/+3
| | | | | | A C++ compiler produces lots of warnings that are probably valid concerns to investigate. p4raw-id: //depot/perl@24170
* 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
* NetWare changeover from Watcom to Codewarrior, from C Aditya.Jarkko Hietaniemi2002-04-221-1/+5
| | | p4raw-id: //depot/perl@16076
* Re: Smoke 14900 /pro/3gl/CPAN/perl-currentH.Merijn Brand2002-03-011-14/+7
| | | | | | From: "H.Merijn Brand" <h.m.brand@hccnet.nl> Message-Id: <20020228173120.6A15.H.M.BRAND@hccnet.nl> p4raw-id: //depot/perl@14921
* Copyright++. (Not all the toplevel *.h have one, it seems.)Jarkko Hietaniemi2002-01-231-1/+1
| | | p4raw-id: //depot/perl@14391
* quiet down VC++ warnings in a2py.c and walk.cNikola Knezevic2001-08-251-7/+7
| | | | | Message-Id: <1065978076.20010824221042@tesla.rcub.bg.ac.yu> p4raw-id: //depot/perl@11744
* -Wall "subscript has type `char'" cleanup.Jarkko Hietaniemi2001-06-031-14/+14
| | | p4raw-id: //depot/perl@10418
* More -Wall silencing from Michael Schwern and Jarkko Hietaniemi.Jarkko Hietaniemi2001-05-301-3/+3
| | | p4raw-id: //depot/perl@10335
* Bump up Larry's copyright.Jarkko Hietaniemi2001-01-011-1/+1
| | | p4raw-id: //depot/perl@8289
* more GCC v2.95 induced adjustmentsGurusamy Sarathy1999-10-271-3/+3
| | | p4raw-id: //depot/perl@4462
* remove _() non-ansismGurusamy Sarathy1999-06-021-7/+7
| | | p4raw-id: //depot/perl@3518
* various little nitsGurusamy Sarathy1999-05-201-2/+2
| | | p4raw-id: //depot/perl@3436
* PATCH: (5.005_02) a2p should use `chomp' instead of `chop'Mark-Jason Dominus1998-10-301-2/+2
| | | | | Message-Id: <19981030192423.27276.qmail@plover.com> p4raw-id: //depot/perl@2151
* Further ANSI changes now builds and passes (most) testsNick Ing-Simmons1997-10-311-24/+12
| | | | | with gcc -x c++. p4raw-id: //depot/ansiperl@196
* Add B<-o> option to a2p, for old awk; make new the defaultChip Salzenberg1997-04-091-1/+1
|
* [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
* perl5.001 patch.1b: [byacc deps fix, set*id fixes, x2p/walk.c emit_split()Andy Dougherty1995-03-311-12/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fix] This is my patch patch.1b for perl5.001. [Actually, that's a lie. This is just a reposting of two of my patches (removing some byacc dependencies and fixing some set*id stuff) + one version of the x2p/walk.c emit_split() patch. I've just usurped the letter 'b' to fit in my patch sequence. You probably have already applied these as well, but again here they are all packaged up nice and neatly for storage on ftp sites.] Here's one possible solution to the byacc problem. Short summary: make will think your perly.[ch] are out of date because perly.c.diff has changed. They aren't really out of date, but the ordering of the timestamps in the distribution fools make. I had put some traps in perly.fixer to check to make sure that everything got run only if you ran the same version of byacc (1.8) as Larry, but the traps aren't good enough: There's a Cygnus version of byacc out there that also calls itself 1.8 (with a +Cygnus xxx note attached). I don't think I'll ever be able to reliably detect all mutant byacc's, so the safest course of action seems to be to never run byacc. (Yes, the perly.fixer check could be a _lot_ smarter. Volunteers?) This simple-minded fix just puts in a perly.c: perly.y - touch perly.c perly.h: perly.y - touch perly.h to bring perly.[ch] up to date, if needed. The '-' are in case your source is read-only. It also does the same trick in x2p/Makefile.SH. WARNING! Danger! Larry, if you do this, it means you have to explicitly call make run_byacc whenever you change perly.y, perly.c.diff, or cd x2p; make run_byacc if you change x2p/a2p.y. However, it might be worth it. I leave it up to you.
* Perl 5.001perl-5.001Larry Wall1995-03-121-4/+10
| | | | [See the Changes file for a list of changes]
* perl5.000 patch.0j: fix minor portability and build problems remaining even ↵Andy Dougherty1995-02-071-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | after patches 0a through 0i Specifically, here's what's included: Configure Regenerated with metaconfig patchlevel 50. This changed a variety of things, mostly related to selecting and changing the installation prefix. Handle csh, sed, and byacc no matter what the setting of d_portable. (This was causing glob problems in patch.0i). Set d_portable to default to 'y'. It doesn't matter anyway, but gives people a warm fuzzy feeling. Remove useless d_group and d_passwd tests. Add check for <sys/stat.h>. Improve & generalize AIX version detection. Consider /opt/man/man1 as a possible place to install man pages. Be a little more robust about OS version changes when deciding if the output of uname -a has really changed. MANIFEST MANIFEST.new Added hints/mpeix.sh. README Tell users the Configure defaults are probably right. Makefile.SH Better detection of whether user has byacc. Use $(MAKE) instead of make. U/Loc_sed.U Works again with d_portable='define'. U/Myinit.U Set d_portable=define as default. U/d_byacc.U Detect whether user has byacc even if d_portable=define. U/d_csh.U Works again with d_portable='define'. U/d_group.U Empty file to avoid useless metaconfig test. U/d_passwd.U Empty file to avoid useless metaconfig test. U/dist.patch This file contains two minor updates to dist3 PL50 that were used to generage Configure. U/i_sysstat.U New test. See if sys/stat.h is available. config.H Updated. config_h.SH Updated to metaconfig patchlevel 50. ext/NDBM_File/Makefile.PL ext/ODBM_File/Makefile.PL Add -lucb for SVR4 systems. handy.h Protect agains g++-2.6.3, which predefines bool. g++ can be used to compile an extension, but not perl itself. Still, the extension will #include "perl.h", which eventually gets "handy.h", which #define's bool. If this happens to you, add -DHAS_BOOL to your ccflags in your extension, or else ensure that _G_config.h is #include'd before perl.h. (_G_config.h will define _G_HAVE_BOOL, if indeed your version of g++ has bool.) hints/aix.sh Updated. Handles AIX 3.2.x and 4.1. Comments included! hints/hpux_9.sh Updated. hints/irix_4.sh Updated. Includes comments for IRIX 4.0.4 hints/linux.sh Updated. Beginnings of ELF support added, but completely untested. hints/mpeix.sh New hint file. hints/solaris_2.sh Useless ccflags="$ccflags" line removed. hints/svr4.sh Updated. installperl Doesn't use Config anymore (it already reads config.sh directly. That's probably backwards, but, oh well. Install perl.exp for AIX. lib/ExtUtils/MakeMaker.pm Upgraded from 4.01 to 4.03. makedepend.SH Use $MAKE instead of plain make. Index: op.c Remove overlapping strcpy(). perl.h Add test for <sys/stat.h>. Delete unused VOIDSIG stuff. Delete unused typedef struct lstring Lstring; perl_exp.SH Add safexxxx calls. pp_sys.c Delete wayward break in HAS_ALARM section. proto.h Change true and false (!) in function prototypes to please g++-2.6.3, which has true and false built in. (See notes for handy.h.) Index: unixish.h Long-overdue housekeeping. HAS_GROUP and HAS_PASSWD are always defined. util.c Yet another (char*) cast for bcmp. vms/config.vms Changed comments to match unixish.h. writemain.SH Now correctly handles nested static extensions. Recent MakeMakers have moved where they get built. x2p/a2p.h More definitions that will doubtless cause trouble somewhere else. x2p/a2py.c x2p/walk.c Remove unprotected char *strchr();
* perl5.000 patch.0i: fix glaring mistakes in patches a-hAndy Dougherty1995-01-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch does the following things: 1. Fix various bonehead errors I introduced in patches a-g. 2. Incorporate MakeMaker changes to bring it up to version 4.01 (mostly). 3. Stick in things I forgot in patches a-g (e.g. AIX). 4. Some minor additional cleanup in x2p/ for even pickier compilers. 5. More hints updates (hpux and next). 6. Include newest dl_hpux.xs. I didn't have time to 1. Fix the overlapping strcpy() in op.c 2. Restore h2xs to Larry's original design to process <>. 3. take out unnecessary "use Config" in installperl. 4. Add in vms patches. I forgot to [If I remembered what i forgot, I wouldn't have forgotten it. :] I deliberately decided *not* to 1. Touch pod/* 2. deal with overloading Specifically, here's what's included: Configure Regenerated to be sure it's up-to-date. Makefile.SH Build extension libraries right into lib/auto/whatever. Don't set CCCDLFLAGS since we don't use it anyway. Take care to avoid modifying lib/Config.pm without reason Visit DynaLoader for `make clean'. (Previously only did so for `make realclean'.) @echo "Note that make realclean does not delete config.sh" Include config.h dependency. U/i_db.U config_h.SH config.H Remove unwanted quotes around db_hashtype and db_prefixtype. configpm Allow specification of alternate name for lib/Config.pm, so the makefile mv-if-diff trick saves needless re-making. ext/DynaLoader/DynaLoader.pm Updated warning messages and comments. ext/DynaLoader/dl_hpux.xs Updated to version 2.1. Now uses bootstrap files. ext/util/make_ext Explicitly use #!/bin/sh to start it up. This is useful for testing make_ext. Improve & simplify Nested::Extension::Processing. More robust handling of `make clean'. hints/hpux_9.sh Support both the bundled and unbundled compilers. hints/next_3_2.sh Back to using -posix rather than POSIX_SOURCE. And that only for ext/POSIX/POSIX.xs. installperl Special ranlib treatment for NeXT, which gets confused about timestamps in libraries, even when you just copy the library. Supply missing '$' in samepath() function. lib/AutoSplit.pm New parameters. lib/ExtUtils/MakeMaker.pm Upgraded from 3.8 to 4.01. lib/ExtUtils/xsubpp Documentation changed from man to pod. lib/Getopt/Long.pm Avoid typo warning. Drop unused $optx. lib/Text/Tabs.pm Fix package name. makedepend.SH Explicitly start with $startsh. Catch cpp that prints # <stdin> instead of line numbers. perl.h Fix bonehead mistake that ended up calling my_fmod even if not needed. perl_exp.SH also add symbols from interp.sym proto.h Delete 2 redundant prototypes (newBINOP and newUNOP). util.c Add (char *) casts to unsigned char args to bcmp. x2p/a2p.h Rearrange order of <string?.h> and bcopy & bzero stuff. Change a few function prototypes to void, to reflect actual usage. x2p/a2py.c Change a few function types to void, to reflect actual usage. x2p/handy.h Make *alloc declarations match those in x2p/util.c. x2p/util.c Make *alloc declarations match those in x2p/handy.h. x2p/walk.c Add a (Size_t) cast for comparison of 1 to the result of strlen(). Thanks to all who's work is included here. Little of it is mine.
* perl5.000 patch.0e: fix various non-broken things in the x2p/ directoryAndy Dougherty1995-01-181-5/+16
| | | | | | | | | | | | | | This patch fixes various non-broken things in the x2p/ directory. Mostly, I've supplied function prototypes to satisfy particularly picky compilers. I've also updated Makefile.SH to know that the byacc-generated a2p.c is now included with the distribution so that we no longer need to go looking for yacc/bison/byacc and deal with various library issues or command line options to support those various compiler compilers. I've included a2p.c generated by byacc-1.9. Larry, feel free to use your own from byacc-1.8 instead.
* perl 5.000perl-5.000Larry Wall1994-10-171-30/+12
| | | | | | | | | | | [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 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 32: patch #20, continuedLarry Wall1992-06-081-10/+26
| | | | See patch #20.
* perl 4.0 patch 18: patch #11, continuedLarry Wall1991-11-051-3/+10
| | | | See patch #11.
* perl 4.0 patch 9: patch #4, continuedLarry Wall1991-06-061-23/+43
| | | | See patch #4.
* perl 4.0.00: (no release announcement available)perl-4.0.00Larry Wall1991-03-211-25/+5
| | | | 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 #36 patch #29, continuedLarry Wall1990-10-151-2/+5
| | | | See patch #29.
* perl 3.0 patch #27 patch #19, continuedLarry Wall1990-08-081-7/+24
| | | | See patch #19.
* perl 3.0 patch #12 patch #9, continuedLarry Wall1990-02-281-3/+6
| | | | See patch #9.
* perl 3.0 patch #8 patch 7 continuedLarry Wall1989-12-211-2/+5
| | | | See patch 7.
* perl 3.0 patch #6 patch 5 continuedLarry Wall1989-11-171-5/+10
| | | | See patch 5.
* perl 3.0 patch #4 Patch #2 continuedLarry Wall1989-11-101-2/+5
|
* perl 3.0: (no announcement message available)perl-3.000Larry Wall1989-10-181-214/+753
| | | | | | | | | | | | | | 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-34/+50
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* perl 1.0 patch 14: a2p incorrectly translates 'for (a in b)' construct.Jeff Siegal1988-02-011-3/+6
| | | | | The code a2p creates for the 'for (a in b)' construct ends up assigning the wrong value to the key variable.
* perl 1.0 patch 12: scripts made by a2p doen't handle leading white space ↵Kriton Kyrimis1988-02-011-6/+7
| | | | | | | | | | | | | | right on input Awk ignores leading whitespace on split. Perl by default does not. The a2p translator couldn't handle this. The fix is partly to a2p and partly to perl. Perl now has a way to specify to split to ignore leading white space as awk does. A2p now takes advantage of that. I also threw in an optimization that let's runtime patterns compile just once if they are known to be constant, so that split(' ') doesn't compile the pattern every time.
* perl 1.0 patch 8: perl needed an eval operator and a symbolic debuggerLarry Wall1988-01-271-4/+7
| | | | | | | | | | | I didn't add an eval operator to the original perl because I hadn't thought of any good uses for it. Recently I thought of some. Along with creating the eval operator, this patch introduces a symbolic debugger for perl scripts, which makes use of eval to interpret some debugging commands. Having eval also lets me emulate awk's FOO=bar command line behavior with a line such as the one a2p now inserts at the beginning of translated scripts.
* a "replacement" for awk and sedperl-1.0Larry Wall1987-12-181-0/+1464
[ 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.