| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Forget the description, it's too late at night...
|
|
|
|
| |
See patch #29.
|
|
|
|
| |
See patch #19.
|
|
|
|
| |
See patch #16.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
I added the list slice operator: (LIST)[LIST]
$hexdigit = (0..9,'a','b','c','d','e','f')[$fourbits]
There was no way to cut stuff out of the middle of an array
or to insert stuff without copying the head and tail of the array,
which is gross. I added the splice operator to do this:
@oldelems = splice(@array,$offset,$len,LIST)
Equivalencies:
splice(@array,0,1)
splice(@array,0,0,$x,$y)
splice(@array,-1,1)
splice(@array,$#array+1,0,$x,$y)
splice(@array,$x,1,$y)
Having -lPW as one of the libraries that Configure looks for
was causing lots of people grief. It was only there for
people using bison who otherwise don't have alloca(), so I
zapped it.
Some of the questions that supported the ~name syntax didn't
say so, and some that should have supported it didn't. Now they do.
If you selected the manp directory for your man pages, the manext
variable was left set to 'n'.
When Configure sees that the optional libraries have previously
been determined in config.sh, it now believes it rather than using
the list it generates.
In the test for byteorder, some compilers get indigestion on the
constant 0x0807060504030201. It's now split into two parts.
Some compilers don't like it if you put CCFLAGS after the .c file
on the command line. Some of the Configure tests did this.
On some systems, the test for vprintf() needs to have stdio.h
included in order to give valid results.
Some machines don't support the volatile declaration as applied
to a pointer. The Configure test now checks for this.
Also, cmd.c had some VOLATILE declarations on pointed-to items
rather than the pointers themselves, causing MIPS heartburn.
In Makefile.SH, some of the t*.c files needed to have dependencies
on perly.h. Additionally, some parallel makes can't handle a
dependency line with two targets, so the perly.h and perl.c lines
have been separated. Also, when perly.h is generated, it will
now have a declaration added to it for yylval--bison wasn't supplying
this.
The construct "while (s/x//) {}" was partially fixed in patch 9, but
there were still some weirdnesses about it. Hopefully these are
ironed out now.
If you did a switch structure based on numeric value, and there
was some action attached to when the variable is greater than
the maximum specified value, that action would not happen. Instead,
any action for values under the minimum value happened.
The debugger had some difficulties after patch 9, due to changes
in the meaning of @array in a scalar context, and because of
an pointer error in patch 9.
Because of the fix in patch 9 to let return () work right, the
construct "return (@array)" did counter-intuitive things. It
now returns an array value. "return @array" and "return (@array)"
now mean the same thing.
A pack of ascii strings could call str_ncat() with negative length
when the length of the string was greater than the length specified
for the field.
Patch 9 fixed *name values so that the wouldn't collide with ordinary
string values, but there were two places I missed, one in perldb,
and one in the sprintf code.
Perl looks at commands it is going to execute to see if it can
bypass /bin/sh and execute them directly. Ordinarily = is not
a shell metacharacter, but in a command like "system 'FOO=bar command'"i
it indicates that /bin/sh should be used, since it's setting an
environment variable. It now does that (other than that construct,
the = character is still not a shell metacharacter).
If a runtime pattern to split happens to be null, it was being
interpreted as if it were a space, that is, as the awk-emulating
split. It now splits all characters apart, since that's more in
line with what people expect, and the other behavior wasn't documented.
Patch 9 added the reserved word "pipe". The scripts eg/g/gsh and
/eg/scan/scanner used pipe as filehandle since they were written
before the recommendation of upper-case filehandles was devised.
They now use PIPE.
The undef $/ command was supposed to let you slurp in an entire
binary file with one <>, but it didn't work as advertised.
Xenix systems have been having problems with Configure setting
up ndir right. Hopefully this will work better now, but it's
possible the changes will blow someone else up. Such is life...
The construct (LIST,) is now legal, so that you can say
@foo = (
1,
2,
3,
);
Various changes were made to the documentation.
In double quoted strings, you could say \0 to mean the null
character. In pattern matches, only \000 was allowed since
\0 was taken to be a \<digit> backreference. Since it doesn't
make sense to refer to the whole matched string before it's done,
there's no reason \0 can't mean null in a pattern too. So now
it does.
You could modify a numeric variable by using substr as an lvalue,
and if you then reference the variable numerically, you'd get
the old number out rather than one derived from the new string.
Now the old number is invalidated on lvalued substr.
The test t/op.mkdir should create directories 0777 rather than 0666.
As Randal requested, the last semicolon of a program is now optional.
Actually, he just asked for -e 'prog' to have that behaviour, but
it seemed reasonable to generalize it slightly. It's been that
way with eval for some time.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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...
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The select operator didn't interpret bit vectors correctly on
non-little-endian machines such as Suns. Rather than bollux up
the rather straightforward interpretation of bit vectors, I made
the select operator rearrange the bytes as necessary. So it
is still true that vec($foo,0,1) refers to the first bit of the
first byte of string $foo, even on big-endian machines.
The send() socket operator didn't correctly allow you to specify
a TO argument even though this was documented. (The TO argument
is desirable for sending datagram packets.)
In ANSI standard C, they decided that longjmp() didn't have to
guarantee anything about registers. Several people sent me
some patches that declared certain variables as volatile
rather than register for such compilers. Rather than go that
route, however, I wanted to keep some of these variables in
registers, so I just made sure that the important ones are
restored from non-register locations after longjmp(). I think
"volatile" encourages people to punt too easily.
The foreach construct still had some difficulty with two nested
foreach loops referring to the same array, and to a single
foreach that called its enclosing subroutine recursively.
I think I've got this straight now. You wouldn't think
a little iterator would give some much trouble.
A pattern like /b*/ wouldn't match a null string before the
first character. And certain patterns didn't match correctly
at end of string. The upshot was that
$_ = 'aaa';
s/b*/x/g;
produced 'axaxa' rather than the expected 'xaxaxax'. This has
been fixed. Note however that the split operator will still
not match a null string before the first character, so that
split(/b*/,'aaa') produces ('a','a','a'), not ('','a','a','a','').
The saga continues, and hopefully concludes. I realized I was
fighting a losing battle trying to grep out all the includes
from <time.h> and <sys/time.h>. There are just too many funny
includes, symbols, links and such on too many kinds of machines.
Configure now compiles a test program several different ways to
figure out which way to define the various symbols.
Configure now lets you pick between yacc or bison for your
compiler compiler. If you pick bison, be sure you have alloca
somewhere on your system.
The ANSI function strerror() is now supported where available.
In addition, errno may now be a macro with an lvalue, so errno
isn't declared extern if it's defined as a macro in <errno.h>.
The memcpy() and memset() are now allowed to return void.
There is now support for sys/ndir.h for systems such as Xenix.
It's now also easier to cross compile on a 386 for a 286.
DG/UX has functions setpgrp2() and getpgrp2() to keep the BSD
sematics separate from the SystemV semantics. So now we have
yet another wonderful non-standard way of doing things. There
is also a utime.h file which lets them put time stamps on
files to microsecond resolutions, though perl doesn't take
advantage of this.
The list of optional libraries to be searched for now includes
-lnet_s, -lnsl_s, -lsocket and -lx. We can now find .h files
down in /usr/include/lan.
Microport systems have problems. I've added some CRIPPLED_CC
support for them, but you still need to read the README.uport
file for some extra rigamarole.
In the README file, there are now hints for what to do if your
compile doesn't work right, and specific hints for machines
known to require certain switches.
The grep operator with a simple first argument, such as grep(1,@array),
didn't work right. That one seems silly, but grep($_,@array)
didn't work either. Now it does.
A /$pat/ followed by a // wrongly freed the runtime pattern twice,
causing ill-will on the part of all concerned.
The ord() function now always returns positive even on signed-char
machines. This seems to be less surprising to people. If you
still want a signed value on such machines, you can always use
unpack.
The lib/complete.pl file misused the @_ array. The array has
been renamed.
In the man page, I clarified that s`pat`repl` does command
substitution on the replacement string, that $timeleft from
select() is likely not implemented in many places, and that
the qualified form package'filehandle works as well as
$package'variable. It is also explicitly stated that
certain identifiers (non-alpha, STDIN, etc.) are always
resolved in package main's symbol table.
Perl didn't grok setuid scripts that had a space on the
first line between the shebang and the interpreter name.
In stab.c, sighandler() may now return either void or int,
depending on the value of VOIDSIG.
You couldn't debug a script that used -p or -n because they would
try to slap an extra } on the end of the perldb.pl file. This
upset the parser.
The interpration of strings like " ''$foo'' " caused problems
because the tokener didn't realize that neither single quote
following the variable was indicating a package qualifier.
(It knew the last one wasn't, but was confused about the first one.)
Merely changing an if to a while fixed it. Well, two if's.
Another place we don't want ' to be interpreted as a package
qualifier is if it's the delimiter for an m'pat' or s'pat'repl'.
These have been grandfathered to look like a match and a substitution.
There were a couple of problems in a2p. First, the ops array
was dimensioned too big on 286's. Second, there was a problem
involving passing a union where I should've passed a member of
the union, which meant user-defined functions didn't work right
on some machines.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Configure had difficulties if the user's path had weird components.
Now Configure appends the user's path to its own.
Some machines need <netinet/in.h> included in order to define
certain macros for packing or unpacking network order data.
On Suns, the shared library is used by default. If it doesn't
contain something contained in /lib/libc.a, then Configure was
getting things wrong (such as gethostent()). Now Configure uses
the shared library if it's there in preference to libc.a.
When gcc was selected as the compiler, the cc flags defaulted to
-fpcc_struct_return. Unfortunately, the underlines should be hyphens.
Configure figures out if BSD shadow passwords are installed and
the getpw* routines now return slightly different data in the
affected fields.
Some of the prompts in Configure with regard to gid and uid types
were unclear as to their intended use. They are now a little
clearer.
Sometimes you could change a .h file and taintperl and suidperl
didn't get remade correctly because of missing dependencies
in the Makefile.
The README file was misleading about the fact that you have to
say "make test" before you can "cd t; TEST"
The reverse operator was busted in two different ways. Should work
better now. There are now regression tests for it.
Some of the optimizations that perl does are disabled after period
of time if perl decides they aren't doing any good. One of these
caused a string to be freed that was later referenced via another
pointer, causing core dumps. The free turned out to be unnecessary,
so it was removed.
The unless modifier was broken when run under the debugger, due to
the invert() routine in perl.y inverting the logic on the DB
subroutine call instead of the command the unless was modifying.
Configure vfork test was backwards. It now works like other defines.
The numeric switch optimization was broken, and caused code to be
bypassed. This has been fixed.
A split in a subroutine that has no target splits into @_.
Unfortunately, this wrongly freed any referenced arguments passed
in through @_, causing confusing behavior later in the program.
File globbing (<foo.*>) left one orphaned string each time it
called the shell to do the glob.
RCS expanded an unintended $Header in lib/perldb.pl. This has
been fixed simply by replacing the $ with a .
Some forward declarations of static functions were missing from
malloc.c.
There's a strut in malloc for mips machines to extend the overhead
union to the size of a double. This was also enabled for sparc
machines.
DEC risc machines are reported to have a buggy memcmp. I've put
some conditional code into perl.h which I think will undef MEMCMP
appropriately.
In perl.man.4, I documented the desirability of using parens even
where they aren't strictly necessary.
I've grandfathered "format stdout" to be the same as "format STDOUT".
Unary operators can be called with no argument. The corresponding
function call form using empty parens () didn't work right, though
it did for certain functions in 2.0. It now works in 3.0.
The string ordering tests were wrong for pairs of strings in which
one string was a prefix of the other. This affected lt, le, gt,
ge, and the sort operator when used with no subroutine.
$/ didn't work with the stupid code used when STDSTDIO was undefined.
The stupid code has been replaced with smarter code that can do
it right. Special thanks to Piet van Oostrum for the code.
Goulds work better if the union in STR is at an 8 byte boundary.
The fields were rearranged somewhat to provide this.
"sort keys %a" should now work right (though parens are still
desirable for readability).
bcopy() needed a forward declaration on some machines.
In x2p/Makefile.SH, added dependency on ../config.sh so that it
gets linked down from above if it got removed for some reason.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
[ 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.
|