diff options
author | Perl 5 Porters <perl5-porters@africa.nicoh.com> | 1997-04-09 00:00:00 +0000 |
---|---|---|
committer | Chip Salzenberg <chip@atlantic.net> | 1997-04-09 00:00:00 +0000 |
commit | 7a2e2cd6e4407ff4fe23355f0373307425305867 (patch) | |
tree | b8bac221ca9fae30bb25f4d8ac3ae8f8d5a1b483 /lib | |
parent | fa85963645b525b23ccb5a91ab9199c740773c41 (diff) | |
download | perl-7a2e2cd6e4407ff4fe23355f0373307425305867.tar.gz |
[inseparable changes from match from perl-5.003_97c to perl-5.003_97d]perl-5.003_97d
DOCUMENTATION
Subject: more (err, less) doubled words
Date: Fri, 11 Apr 1997 22:31:25 +0300 (EET DST)
From: Jarkko Hietaniemi <Jarkko.Hietaniemi@cc.hut.fi>
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
private-msgid: 199704111931.WAA24460@alpha.hut.fi
LIBRARY AND EXTENSIONS
Subject: win32: perl5db patch
Date: Thu, 10 Apr 1997 17:42:13 -0400
From: Gurusamy Sarathy <gsar@engin.umich.edu>
Files: lib/perl5db.pl
Msg-ID: 199704102142.RAA27396@aatma.engin.umich.edu
(applied based on p5p patch as commit 56cbacacb6c634a626b06407cbd555bc1519a2d5)
Subject: Enhancements to debugger, Term::ReadLine, Term::Cap
Date: Thu, 10 Apr 1997 15:48:07 -0400 (EDT)
From: Ilya Zakharevich <ilya@math.ohio-state.edu>
Files: lib/Term/Cap.pm lib/Term/ReadLine.pm lib/perl5db.pl
Msg-ID: 199704101948.PAA01841@monk.mps.ohio-state.edu
(applied based on p5p patch as commit 6fb2d361298c4eb5d42f1f63b0f74a60d407e546)
OTHER CORE CHANGES
Subject: New error msg for low-key failure of C<require>
From: Chip Salzenberg <chip@perl.com>
Files: pod/perldiag.pod pp_ctl.c t/pragma/strict-subs t/pragma/strict-vars
Diffstat (limited to 'lib')
-rw-r--r-- | lib/CGI.pm | 10 | ||||
-rw-r--r-- | lib/Exporter.pm | 2 | ||||
-rw-r--r-- | lib/ExtUtils/MakeMaker.pm | 2 | ||||
-rw-r--r-- | lib/IPC/Open2.pm | 6 | ||||
-rw-r--r-- | lib/IPC/Open3.pm | 2 | ||||
-rw-r--r-- | lib/Term/Cap.pm | 7 | ||||
-rw-r--r-- | lib/Term/ReadLine.pm | 46 | ||||
-rw-r--r-- | lib/perl5db.pl | 19 | ||||
-rw-r--r-- | lib/vars.pm | 13 |
9 files changed, 82 insertions, 25 deletions
diff --git a/lib/CGI.pm b/lib/CGI.pm index 0c869d7262..28fe43b2f1 100644 --- a/lib/CGI.pm +++ b/lib/CGI.pm @@ -3143,7 +3143,7 @@ produce both the unofficial Location: header and the official URI: 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. @@ -3793,7 +3793,7 @@ list. Otherwise, they will be strung together on a horizontal line. =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. @@ -4390,9 +4390,9 @@ You can pass a value of 'true' to dump() in order to get it to 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"; diff --git a/lib/Exporter.pm b/lib/Exporter.pm index 7b03732790..66459b8af0 100644 --- a/lib/Exporter.pm +++ b/lib/Exporter.pm @@ -370,7 +370,7 @@ or constants that may not exist on some systems. 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: diff --git a/lib/ExtUtils/MakeMaker.pm b/lib/ExtUtils/MakeMaker.pm index 273ebe7084..b03ccee7be 100644 --- a/lib/ExtUtils/MakeMaker.pm +++ b/lib/ExtUtils/MakeMaker.pm @@ -66,7 +66,7 @@ package ExtUtils::Liblist; 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'; diff --git a/lib/IPC/Open2.pm b/lib/IPC/Open2.pm index f4ae7482e2..32282d62b3 100644 --- a/lib/IPC/Open2.pm +++ b/lib/IPC/Open2.pm @@ -54,9 +54,9 @@ a time. Programs like B<sort> that read their entire input stream first, 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 diff --git a/lib/IPC/Open3.pm b/lib/IPC/Open3.pm index cfa8932432..43caa03763 100644 --- a/lib/IPC/Open3.pm +++ b/lib/IPC/Open3.pm @@ -57,7 +57,7 @@ time. Programs like B<sort> that read their entire input stream first, 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. diff --git a/lib/Term/Cap.pm b/lib/Term/Cap.pm index 0b3b4aa4ad..5703405c9d 100644 --- a/lib/Term/Cap.pm +++ b/lib/Term/Cap.pm @@ -104,8 +104,11 @@ as C<$self-E<gt>{TERMCAP}>. 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})) diff --git a/lib/Term/ReadLine.pm b/lib/Term/ReadLine.pm index 7b735eb424..a52b558b22 100644 --- a/lib/Term/ReadLine.pm +++ b/lib/Term/ReadLine.pm @@ -105,6 +105,15 @@ support reacher set of commands. 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 @@ -121,20 +130,22 @@ If the variable is not set, the best available package is loaded. =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; @@ -200,7 +211,7 @@ sub OUT { shift->[1] } 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? @@ -233,6 +244,35 @@ if (defined &Term::ReadLine::Gnu::readline) { @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; diff --git a/lib/perl5db.pl b/lib/perl5db.pl index 9718fede67..d0a712534a 100644 --- a/lib/perl5db.pl +++ b/lib/perl5db.pl @@ -2,7 +2,7 @@ package DB; # 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) @@ -177,7 +177,7 @@ $inhibit_exit = $option{PrintRet} = 1; 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 = ( @@ -211,6 +211,7 @@ $inhibit_exit = $option{PrintRet} = 1; warnLevel => \&warnLevel, dieLevel => \&dieLevel, tkRunning => \&tkRunning, + ornaments => \&ornaments, ); %optionRequire = ( @@ -285,7 +286,7 @@ if ($notty) { if (-e "/dev/tty") { $console = "/dev/tty"; - } elsif (-e "con") { + } elsif (-e "con" or $^O eq 'MSWin32') { $console = "con"; } else { $console = "sys\$command"; @@ -1374,6 +1375,7 @@ sub setterm { if ($term->Features->{setHistory} and "@hist" ne "?") { $term->SetHistory(@hist); } + ornaments($ornaments) if defined $ornaments; } sub readline { @@ -1563,6 +1565,16 @@ sub shellBang { $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; @@ -1679,6 +1691,7 @@ O [opt[=val]] [opt\"val\"] [opt?]... 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. diff --git a/lib/vars.pm b/lib/vars.pm index 0b7dacc751..e007baa7b9 100644 --- a/lib/vars.pm +++ b/lib/vars.pm @@ -19,12 +19,13 @@ C<use subs> declarations are not BLOCK-scoped. They are thus effective 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>. |