summaryrefslogtreecommitdiff
path: root/handy.h
Commit message (Collapse)AuthorAgeFilesLines
* perl 3.0 patch #22 patch #19, continuedLarry Wall1990-08-081-1/+13
| | | | See patch #19.
* perl 3.0 patch #5 (combined patch)Larry Wall1989-11-171-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some machines have bcopy() but not bzero(), so Configure tests for them separately now. Likewise for symlink() and lstat(). Some systems have dirent.h but not readdir(). The symbols BZERO, LSTAT and READDIR are now used to differentiate. Some machines have <time.h> including <sys/time.h>. Some do the opposite. Some don't even have <sys/time.h>. Configure now looks for both kinds of include, and the saga continues... Configure tested twice for the presence of -lnm because x2p/Makefile.SH had a reference to the obsolete $libnm variable. It now tests only once. Some machines have goodies stashed in /usr/include/sun, /usr/include/bsd, -lsun and -lbsd. Configure now checks those locations. Configure could sometimes add an option to a default of none, producing [none -DDEBUGGING] prompts. This is fixed. Many of the units in metaconfig used the construct if xxx=`loc...`; then On most machines the exit status of loc ends up in $?, but on a few machines, the assignment apparently sets $? to 0, since it always succeeds. Oh well... The tests for byte order had difficulties with illegal octal digits and constants that were too long, as well as not defining the union in try.c correctly. When <dirent.h> was missing, it was assumed that the field d_namlen existed. There is now an explicit check of <sys/dir.h> for the field. The tests of <signal.h> to see how signal() is declared needed to have signal.h run through the C preprocessor first because of POSIX ifdefs. The type returned by getgroups() was defaulting wrong on Suns and such. Configure now checks against the lint library if it exists to produce a better default. The construct foreach $elem (@array) { foreach $elem (@array) { ... } } didn't work right because the iterator for the array was stored with the array rather than with the node in the syntax tree. If you said defined $foo{'bar'} it would create the element $foo{'bar'} while returning the correct value. It now no longer creates the value. The grep() function was occasionally losing arguments or dumping core. This was because it called eval() on each argument but didn't account for the fact that eval() is capable of reallocating the stack. If you said $something ? $foo[1] : $foo[2] you ended up (usually) with $something ? $foo[0] : $foo[0] because of the way the ?: operator tries to fool the stack into thinking there's only one argument there instead of three. This only happened to constant subscripts. Interestingly enough, $abc[1] ? $foo[1] : $bar[1] would have worked, since the first argument has the same subscript. Some machines already define TRUE and FALSE, so we have to undef them to avoid warnings. Several people sent in some fixes for manual typos and indent problems. There was a reqeust to clarify the difference between $! and $@, and I added a gratuitous warning about print making an array context for its arguments, since people seem to run into that frequently. suidperl could correctly emulate a setgid script, but then it could get confused about what the actual effective gid was. Some machine or other defines sighandler(), so perl's sighandler() needed to be made static. We changed uchar to unchar for Crays, and it turns out that lots of SysV machines typedef unchar instead. Sigh. It's now un_char. If you did substitutions to chop leading components off a string, and then set the string from <filehandle>, under certain circumstances the input string could be corrupted because str_gets() called str_grow() without making sure to change the strings current length to be the number of characters just read, rather than the old length. op.stat occasionally failed with NFS race condition, so it now waits two seconds instead of one to guarantee that the NFS server advances its clock at least one second. IBM PC/RT compiler can't deal with UNI() and LOP() macros. If you define CRIPPLED_CC it now will recast those macros as subroutines, which runs a little slower but doesn't give the compiler heartburn. The } character can terminate either an associative array subscript or a BLOCK. These set up different expectations as to whether the next token might be a term or an operator. There was a faulty heuristic based on whether there was an intervening newline. It turns out that if } simply leaves the current expectations along, the right thing happens. The command y/abcde// didn't work because the length of the first part was not correctly copied to the second part. In s2p, line labels without a subsequent statement were done wrong, since an extra semicolon needs to be supplied. It wasn't always suppplied, and when it was supplied, it was in the wrong place. S2p also needed to remove its /tmp files better. A2p translates for (a in b) to foreach $a} (keys(%b)) on Pyramids, because index(s, '}' + 128) doesn't find a } with the top bit set. This has been fixed.
* perl 3.0: (no announcement message available)perl-3.000Larry Wall1989-10-181-4/+57
| | | | | | | | | | | | | | 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-4/+19
| | | | | | | | | | | | | | | | | | | | | | | | 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/+26
[ 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.