-------------------
+ Version 5.003_97d
+-------------------
+
+Any minute now... second public beta... no, really...
+
+ CORE LANGUAGE CHANGES
+
+ Title: "Fix for incorrect overloaded assignment"
+ From: Ilya Zakharevich
+ Msg-ID: <199704112225.SAA03482@monk.mps.ohio-state.edu>
+ Date: Fri, 11 Apr 1997 18:25:33 -0400 (EDT)
+ Files: gv.c
+
+ Title: "Fix C< $x=''; pos($x)=0; $x=~/\G$/ >"
+ From: Chip Salzenberg
+ Files: pp_hot.c
+
+ Title: "Fix label on C<for(;;)> statement"
+ From: Chip Salzenberg
+ Files: perly.c perly.y
+
+ CORE PORTABILITY
+
+ Title: "update to 5.003_97b/hint/irix_6_2.sh"
+ From: Scott Henry <scotth@sgi.com>
+ Msg-ID: <yd8hghdjbk0.fsf@hoshi.engr.sgi.com>
+ Date: 11 Apr 1997 18:05:03 -0700
+ Files: hints/irix_6_2.sh
+
+ OTHER CORE CHANGES
+
+ Title: "Before 'BEGIN not safe', explain why"
+ From: Chip Salzenberg
+ Files: op.c
+
+ Title: "New error msg for low-key failure of C<require>"
+ From: Chip Salzenberg
+ Files: pod/perldiag.pod pp_ctl.c t/pragma/strict-subs
+ t/pragma/strict-vars
+
+ Title: "Put "dXSUB_SYS" last in declarations"
+ From: Chip Salzenberg
+ Files: win32/perllib.c
+
+ Title: "Minor type cleanup"
+ From: Chip Salzenberg
+ Files: proto.h toke.c
+
+ BUILD PROCESS
+
+ (no changes)
+
+ LIBRARY AND EXTENSIONS
+
+ Title: "win32: perl5db patch"
+ From: Gurusamy Sarathy
+ Msg-ID: <199704102142.RAA27396@aatma.engin.umich.edu>
+ Date: Thu, 10 Apr 1997 17:42:13 -0400
+ Files: lib/perl5db.pl
+
+ Title: "Enhancements to debugger, Term::ReadLine, Term::Cap"
+ From: Ilya Zakharevich
+ Msg-ID: <199704101948.PAA01841@monk.mps.ohio-state.edu>
+ Date: Thu, 10 Apr 1997 15:48:07 -0400 (EDT)
+ Files: lib/Term/Cap.pm lib/Term/ReadLine.pm lib/perl5db.pl
+
+ Title: "MM_Unix patch for use under CVS"
+ From: Ulrich Pfeifer
+ Msg-ID: <yfmd8s1vhpn.fsf@ls6.informatik.uni-dortmund.de>
+ Date: 11 Apr 1997 14:59:00 +0200
+ Files: lib/ExtUtils/MM_Unix.pm
+
+ Title: "Complex update (five patches)"
+ From: Jarkko Hietaniemi
+ Files: lib/Math/Complex.pm t/lib/complex.t
+
+ Title: "Fix undef warning in Math::BigInt"
+ From: Chip Salzenberg
+ Files: lib/Math/BigInt.pm
+
+ TESTS
+
+ (no other changes)
+
+ UTILITIES
+
+ Title: "Add B<-o> option to a2p, for old awk; make new the default"
+ From: Chip Salzenberg
+ Files: x2p/a2p.h x2p/a2p.pod x2p/a2py.c x2p/walk.c
+
+ DOCUMENTATION
+
+ Title: "typo in lib/diagnostics.pm"
+ From: barnett@grymoire.crd.ge.com (Bruce Barnett)
+ Msg-ID: <199704111800.OAA27297@grymoire.crd.ge.com>
+ Date: Fri, 11 Apr 1997 14:00:54 -0400
+ Files: lib/diagnostics.pm
+
+ Title: "Use B<> for options in Class::Struct pod"
+ From: Hugo van der Sanden <hv@iii.co.uk>
+ Msg-ID: <334D2E7B.67F0@iii.co.uk>
+ Date: Thu, 10 Apr 1997 19:16:27 +0100
+ Files: lib/Class/Struct.pm
+
+ Title: "Explain //g and \G issues"
+ From: Gurusamy Sarathy
+ Msg-ID: <199704122048.QAA25060@aatma.engin.umich.edu>
+ Date: Sat, 12 Apr 1997 16:48:41 -0400
+ Files: pod/perldelta.pod pod/perlop.pod pod/perlre.pod
+
+ Title: "more (err, less) doubled words"
+ From: Jarkko Hietaniemi
+ Msg-ID: <199704111931.WAA24460@alpha.hut.fi>
+ Date: Fri, 11 Apr 1997 22:31:25 +0300 (EET DST)
+ Files: ext/DB_File/DB_File.pm ext/DynaLoader/DynaLoader.pm
+ ext/IO/lib/IO/Pipe.pm lib/CGI.pm lib/Exporter.pm
+ lib/ExtUtils/MakeMaker.pm lib/IPC/Open2.pm lib/IPC/Open3.pm
+ lib/vars.pm pod/perlcall.pod pod/perldiag.pod
+ pod/perlfaq1.pod pod/perlfaq3.pod pod/perlfaq5.pod
+ pod/perlfaq7.pod pod/perlfaq8.pod pod/perlipc.pod
+
+ Title: "Freudian slip error in perlsub.pod"
+ From: barnett@grymoire.crd.ge.com (Bruce Barnett)
+ Msg-ID: <199704111755.NAA27200@grymoire.crd.ge.com>
+ Date: Fri, 11 Apr 1997 13:55:07 -0400
+ Files: pod/perlsub.pod
+
+ Title: "Little patch for perl5.003_97c/pod/perlpod.pod"
+ From: rse@engelschall.com (Ralf S. Engelschall)
+ Msg-ID: <199704112048.WAA08733@en1.engelschall.com>
+ Date: Fri, 11 Apr 1997 22:48:37 +0200
+ Files: pod/perlpod.pod
+
+
+-------------------
Version 5.003_97c
-------------------
1;
__END__
-=cut
-
=head1 NAME
DB_File - Perl5 access to Berkeley DB
In list context, it returns all the values which match C<$key>. Note
that the values will be returned in an apparently random order.
-In list context, if the second parameter is present and evaluates TRUE,
-the method returns an associative array. The keys of the associative
-array correspond to the the values that matched in the BTREE and the
-values of the array are a count of the number of times that particular
-value occurred in the BTREE.
+In list context, if the second parameter is present and evaluates
+TRUE, the method returns an associative array. The keys of the
+associative array correspond to the values that matched in the BTREE
+and the values of the array are a count of the number of times that
+particular value occurred in the BTREE.
So assuming the database created above, we can use C<get_dup> like
this:
=head2 The untie() Gotcha
-If you make use of the Berkeley DB API, it is is I<very> strongly
+If you make use of the Berkeley DB API, it is I<very> strongly
recommended that you read L<perltie/The untie Gotcha>.
Even if you don't currently make use of the API interface, it is still
later call to load_file().
This is only required on some platforms which do not handle dependent
-libraries automatically. For example the Socket Perl extension library
-(F<auto/Socket/Socket.so>) contains references to many socket functions
-which need to be resolved when it's loaded. Most platforms will
-automatically know where to find the 'dependent' library (e.g.,
-F</usr/lib/libsocket.so>). A few platforms need to to be told the location
-of the dependent library explicitly. Use @dl_resolve_using for this.
+libraries automatically. For example the Socket Perl extension
+library (F<auto/Socket/Socket.so>) contains references to many socket
+functions which need to be resolved when it's loaded. Most platforms
+will automatically know where to find the 'dependent' library (e.g.,
+F</usr/lib/libsocket.so>). A few platforms need to be told the
+location of the dependent library explicitly. Use @dl_resolve_using
+for this.
Example usage:
=item new ( [READER, WRITER] )
-Creates a C<IO::Pipe>, which is a reference to a
-newly created symbol (see the C<Symbol> package). C<IO::Pipe::new>
-optionally takes two arguments, which should be objects blessed into
-C<IO::Handle>, or a subclass thereof. These two objects will be used
-for the system call to C<pipe>. If no arguments are given then then
-method C<handles> is called on the new C<IO::Pipe> object.
+Creates a C<IO::Pipe>, which is a reference to a newly created symbol
+(see the C<Symbol> package). C<IO::Pipe::new> optionally takes two
+arguments, which should be objects blessed into C<IO::Handle>, or a
+subclass thereof. These two objects will be used for the system call
+to C<pipe>. If no arguments are given then method C<handles> is called
+on the new C<IO::Pipe> object.
These two handles are held in the array part of the GLOB until either
C<reader> or C<writer> is called.
header. This should satisfy most servers and browsers.
One hint I can offer is that relative links may not work correctly
-when when you generate a redirection to another document on your site.
+when you generate a redirection to another document on your site.
This is due to a well-intentioned optimization that some servers use.
The solution to this is to use the full URL (including the http: part)
of the document you are redirecting to.
=item 4.
The optional fifth argument is a pointer to an associative array
-relating the checkbox values to the user-visible labels that will will
+relating the checkbox values to the user-visible labels that will
be printed next to them (-labels). If not provided, the values will
be used as the default.
print the results out as plain text, suitable for incorporating
into a <PRE> section.
-As a shortcut, as of version 1.56 you can interpolate the entire
-CGI object into a string and it will be replaced with the
-the a nice HTML dump shown above:
+As a shortcut, as of version 1.56 you can interpolate the entire CGI
+object into a string and it will be replaced with the a nice HTML dump
+shown above:
$query=new CGI;
print "<H2>Current Values</H2> $query\n";
The names of any symbols that cannot be exported should be listed
in the C<@EXPORT_FAIL> array.
-If a module attempts to import any of these symbols the Exporter will
+If a module attempts to import any of these symbols the Exporter
will give the module an opportunity to handle the situation before
generating an error. The Exporter will call an export_fail method
with a list of the failed symbols:
package ExtUtils::MakeMaker;
#
-# Now we can can pull in the friends
+# Now we can pull in the friends
#
$Is_VMS = $^O eq 'VMS';
$Is_OS2 = $^O eq 'os2';
however, are quite apt to cause deadlock.
The big problem with this approach is that if you don't have control
-over source code being run in the the child process, you can't control what it does
-with pipe buffering. Thus you can't just open a pipe to C<cat -v> and continually
-read and write a line from it.
+over source code being run in the child process, you can't control
+what it does with pipe buffering. Thus you can't just open a pipe to
+C<cat -v> and continually read and write a line from it.
=head1 SEE ALSO
however, are quite apt to cause deadlock.
The big problem with this approach is that if you don't have control
-over source code being run in the the child process, you can't control
+over source code being run in the child process, you can't control
what it does with pipe buffering. Thus you can't just open a pipe to
C<cat -v> and continually read and write a line from it.
sub termcap_path { ## private
my @termcap_path;
# $TERMCAP, if it's a filespec
- push(@termcap_path, $ENV{TERMCAP}) if ((exists $ENV{TERMCAP}) &&
- ($ENV{TERMCAP} =~ /^\//));
+ push(@termcap_path, $ENV{TERMCAP})
+ if ((exists $ENV{TERMCAP}) &&
+ (($^O eq 'os2' || $^O eq 'MSWin32')
+ ? $ENV{TERMCAP} =~ /^[a-z]:[\\\/]/i
+ : $ENV{TERMCAP} =~ /^\//));
if ((exists $ENV{TERMPATH}) && ($ENV{TERMPATH})) {
# Add the users $TERMPATH
push(@termcap_path, split(/(:|\s+)/, $ENV{TERMPATH}))
All these commands are callable via method interface and have names
which conform to standard conventions with the leading C<rl_> stripped.
+The stub package included with the perl distribution allows two
+additional methods: C<tkRunning> and C<ornaments>. The first one
+makes Tk event loop run when waiting for user input (i.e., during
+C<readline> method), the second one makes the command line stand out
+by using termcap data. The argument to C<ornaments> should be 0, 1,
+or a string of a form "aa,bb,cc,dd". Four components of this string
+should be names of I<terminal capacities>, first two will be issued to
+make the prompt standout, last two to make the input line standout.
+
=head1 EXPORTS
None
=cut
package Term::ReadLine::Stub;
-@ISA = 'Term::ReadLine::Tk';
+@ISA = qw'Term::ReadLine::Tk Term::ReadLine::TermCap';
$DB::emacs = $DB::emacs; # To peacify -w
+*rl_term_set = \@Term::ReadLine::TermCap::rl_term_set;
sub ReadLine {'Term::ReadLine::Stub'}
sub readline {
my $self = shift;
my ($in,$out,$str) = @$self;
- print $out shift;
+ print $out $rl_term_set[0], shift, $rl_term_set[1], $rl_term_set[2];
$self->register_Tk
if not $Term::ReadLine::registered and $Term::ReadLine::toloop
and defined &Tk::DoOneEvent;
#$str = scalar <$in>;
$str = $self->get_line;
+ print $out $rl_term_set[3];
# bug in 5.000: chomping empty string creats length -1:
chomp $str if defined $str;
$str;
sub MinLine { undef }
sub Attribs { {} }
-my %features = (tkRunning => 1);
+my %features = (tkRunning => 1, ornaments => 1);
sub Features { \%features }
package Term::ReadLine; # So late to allow the above code be defined?
@ISA = qw(Term::ReadLine::Stub);
}
+package Term::ReadLine::TermCap;
+
+# Prompt-start, prompt-end, command-line-start, command-line-end
+# -- zero-width beautifies to emit around prompt and the command line.
+@rl_term_set = ("","","","");
+# string encoded:
+$rl_term_set = ',,,';
+
+sub LoadTermCap {
+ return if defined $terminal;
+
+ require Term::Cap;
+ $terminal = Tgetent Term::Cap ({OSPEED => 9600}); # Avoid warning.
+}
+
+sub ornaments {
+ shift;
+ return $rl_term_set unless @_;
+ $rl_term_set = shift;
+ $rl_term_set ||= ',,,';
+ $rl_term_set = 'us,ue,md,me' if $rl_term_set == 1;
+ my @ts = split /,/, $rl_term_set, 4;
+ eval { LoadTermCap };
+ warn("Cannot find termcap: $@\n"), return unless defined $terminal;
+ @rl_term_set = map {$_ ? $terminal->Tputs($_,1) || '' : ''} @ts;
+ return $rl_term_set;
+}
+
+
package Term::ReadLine::Tk;
$count_handle = $count_DoOne = $count_loop = 0;
# Debugger for Perl 5.00x; perl5db.pl patch level:
-$VERSION = 0.9909;
+$VERSION = 0.9911;
$header = "perl5db.pl patch level $VERSION";
# Enhanced by ilya@math.ohio-state.edu (Ilya Zakharevich)
compactDump veryCompact quote HighBit undefPrint
globPrint PrintRet UsageOnly frame AutoTrace
TTY noTTY ReadLine NonStop LineInfo maxTraceLen
- recallCommand ShellBang pager tkRunning
+ recallCommand ShellBang pager tkRunning ornaments
signalLevel warnLevel dieLevel inhibit_exit);
%optionVars = (
warnLevel => \&warnLevel,
dieLevel => \&dieLevel,
tkRunning => \&tkRunning,
+ ornaments => \&ornaments,
);
%optionRequire = (
if (-e "/dev/tty") {
$console = "/dev/tty";
- } elsif (-e "con") {
+ } elsif (-e "con" or $^O eq 'MSWin32') {
$console = "con";
} else {
$console = "sys\$command";
if ($term->Features->{setHistory} and "@hist" ne "?") {
$term->SetHistory(@hist);
}
+ ornaments($ornaments) if defined $ornaments;
}
sub readline {
$psh;
}
+sub ornaments {
+ if (defined $term) {
+ local ($warnLevel,$dieLevel) = (0, 1);
+ return '' unless $term->Features->{ornaments};
+ eval { $term->ornaments(@_) } || '';
+ } else {
+ $ornaments = shift;
+ }
+}
+
sub recallCommand {
if (@_) {
$rc = quotemeta shift;
frame affects printing messages on entry and exit from subroutines.
AutoTrace affects printing messages on every possible breaking point.
maxTraceLen gives maximal length of evals/args listed in stack trace.
+ ornaments affects screen appearance of the command line.
During startup options are initialized from \$ENV{PERLDB_OPTS}.
You can put additional initialization options TTY, noTTY,
ReadLine, and NonStop there.
for the entire file in which they appear. You may not rescind such
declarations with C<no vars> or C<no subs>.
-Packages such as the B<AutoLoader> and B<SelfLoader> that delay loading
-of subroutines within packages can create problems with package lexicals
-defined using C<my()>. While the B<vars> pragma cannot duplicate the
-effect of package lexicals (total transparency outside of the package),
-it can act as an acceptable substitute by pre-declaring global symbols,
-ensuring their availability to to the later-loaded routines.
+Packages such as the B<AutoLoader> and B<SelfLoader> that delay
+loading of subroutines within packages can create problems with
+package lexicals defined using C<my()>. While the B<vars> pragma
+cannot duplicate the effect of package lexicals (total transparency
+outside of the package), it can act as an acceptable substitute by
+pre-declaring global symbols, ensuring their availability to the
+later-loaded routines.
See L<perlmod/Pragmatic Modules>.
,"Dev97A - First development patch to 5.003_97"
,"Dev97B - Second development patch to 5.003_97"
,"Dev97C - Third development patch to 5.003_97"
+ ,"Dev97D - Fourth development patch to 5.003_97"
,NULL
};
executing subroutine in Perl with I<wantarray>. The equivalent test
can be made in C by using the C<GIMME_V> macro, which returns
C<G_ARRAY> if you have been called in an array context, C<G_SCALAR> if
-in a a scalar context, or C<G_VOID> if in a void context (i.e. the
+in a scalar context, or C<G_VOID> if in a void context (i.e. the
return value will not be used). An older version of this macro is
called C<GIMME>; in a void context it returns C<G_SCALAR> instead of
C<G_VOID>. An example of using the C<GIMME_V> macro is shown in
=item Can't locate %s in @INC
-(F) You said to do (or require, or use) a file that couldn't be found in
+(F) You said to do (or require, or use) a file that couldn't be found
in any of the libraries mentioned in @INC. Perhaps you need to set the
PERL5LIB or PERL5OPT environment variable to say where the extra library
is, or maybe the script needs to add the library name to @INC. Or maybe
(W) You tried to close a filehandle that was never opened.
+=item Compilation failed in require
+
+(F) Perl could not compile a file specified in a C<require> statement.
+Perl uses this generic message when none of the errors that it encountered
+were severe enough to halt compilation immediately.
+
=item connect() on closed fd
(W) You tried to do a connect on a closed socket. Did you forget to check
It doesn't matter.
In "standard terminology" a I<program> has been compiled to physical
-machine code once, and can then be be run multiple times, whereas a
+machine code once, and can then be run multiple times, whereas a
I<script> must be translated by a program each time it's used. Perl
programs, however, are usually neither strictly compiled nor strictly
interpreted. They can be compiled to a bytecode form (something of a Perl
own Win95/NT Perl using WinGCC, then you'll have to modify the
Registry yourself.
-Macintosh perl scripts will have the the appropriate Creator and
+Macintosh perl scripts will have the appropriate Creator and
Type, so that double-clicking them will invoke the perl application.
I<IMPORTANT!>: Whatever you do, PLEASE don't get frustrated, and just
except that lamentably, file creation (and deletion) is not atomic
over NFS, so this won't work (at least, not every time) over the net.
-Various schemes involving involving link() have been suggested, but
-these tend to involve busy-wait, which is also subdesirable.
+Various schemes involving link() have been suggested, but these tend
+to involve busy-wait, which is also subdesirable.
=head2 I still don't get locking. I just want to increment the number
in the file. How can I do this?
To pass regexps around, you'll need to either use one of the highly
experimental regular expression modules from CPAN (Nick Ing-Simmons's
-Regexp or Ilya Zakharevich's Devel::Regexp), pass around strings
-and use an exception-trapping eval, or else be be very, very clever.
-Here's an example of how to pass in a string to be regexp compared:
+Regexp or Ilya Zakharevich's Devel::Regexp), pass around strings and
+use an exception-trapping eval, or else be very, very clever. Here's
+an example of how to pass in a string to be regexp compared:
sub compare($$) {
my ($val1, $regexp) = @_;
=item *
-Open /dev/tty and use the the TIOCNOTTY ioctl on it. See L<tty(4)>
+Open /dev/tty and use the TIOCNOTTY ioctl on it. See L<tty(4)>
for details.
=item *
=item *
-Open /dev/tty and use the the TIOCNOTTY ioctl on it. See L<tty(4)>
+Open /dev/tty and use the TIOCNOTTY ioctl on it. See L<tty(4)>
for details.
=item *
delete on slices, flock, printf and sprintf, keys as an lvalue, my() in
Control Structures, unpack() and pack(), use VERSION, use Module VERSION
-LIST, prototype(FUNCTION), srand, $_ as Default, C<m//g> does not trigger a
-pos() reset on failure, C<m//x> ignores whitespace before ?*+{}, nested
+LIST, prototype(FUNCTION), srand, $_ as Default, C<m//g> does not reset
+search position on failure, C<m//x> ignores whitespace before ?*+{}, nested
C<sub{}> closures work now, formats work right on changing lexicals
=item New builtin methods
LEAVE;
- if (optype == OP_REQUIRE)
- DIE("%s", SvPVx(GvSV(errgv), na));
+ if (optype == OP_REQUIRE) {
+ char* msg = SvPVx(GvSV(errgv), na);
+ DIE("%s", *msg ? msg : "Compilation failed in require");
+ }
return pop_return();
}
}
pop_return();
lex_end();
LEAVE;
- if (optype == OP_REQUIRE)
- DIE("%s", SvPVx(GvSV(errgv), na));
+ if (optype == OP_REQUIRE) {
+ char* msg = SvPVx(GvSV(errgv), na);
+ DIE("%s", *msg ? msg : "Compilation failed in require");
+ }
SvREFCNT_dec(rs);
rs = SvREFCNT_inc(nrs);
RETPUSHUNDEF;
require "./abc";
EXPECT
Bareword "Fred" not allowed while "strict subs" in use at ./abc line 2.
- at - line 2.
+Compilation failed in require at - line 2.
########
--FILE-- abc.pm
use abc;
EXPECT
Bareword "Fred" not allowed while "strict subs" in use at abc.pm line 2.
- at - line 2.
+Compilation failed in require at - line 2.
BEGIN failed--compilation aborted at - line 2.
########
EXPECT
Variable "$joe" is not imported at ./abc line 2.
Global symbol "joe" requires explicit package name at ./abc line 2.
- at - line 2.
+Compilation failed in require at - line 2.
########
--FILE-- abc.pm
EXPECT
Variable "$joe" is not imported at abc.pm line 2.
Global symbol "joe" requires explicit package name at abc.pm line 2.
- at - line 2.
+Compilation failed in require at - line 2.
BEGIN failed--compilation aborted at - line 2.
########