📄 perl56delta.pod
字号:
The class method C<display_format> and the corresponding object methodC<display_format>, in addition to accepting just one argument, now canalso accept a parameter hash. Recognized keys of a parameter hash areC<"style">, which corresponds to the old one parameter case, and twonew parameters: C<"format">, which is a printf()-style format string(defaults usually to C<"%.15g">, you can revert to the default bysetting the format string to C<undef>) used for both parts of acomplex number, and C<"polar_pretty_print"> (defaults to true),which controls whether an attempt is made to try to recognize smallmultiples and rationals of pi (2pi, pi/2) at the argument (angle) of apolar complex number.The potentially disruptive change is that in list context both methodsnow I<return the parameter hash>, instead of only the value of theC<"style"> parameter.=item Math::TrigA little bit of radial trigonometry (cylindrical and spherical),radial coordinate conversions, and the great circle distance were added.=item Pod::Parser, Pod::InputObjectsPod::Parser is a base class for parsing and selecting sections ofpod documentation from an input stream. This module takes care ofidentifying pod paragraphs and commands in the input and hands off theparsed paragraphs and commands to user-defined methods which are freeto interpret or translate them as they see fit.Pod::InputObjects defines some input objects needed by Pod::Parser, andfor advanced users of Pod::Parser that need more about a command besidesits name and text.As of release 5.6.0 of Perl, Pod::Parser is now the officially sanctioned"base parser code" recommended for use by all pod2xxx translators.Pod::Text (pod2text) and Pod::Man (pod2man) have already been convertedto use Pod::Parser and efforts to convert Pod::HTML (pod2html) are alreadyunderway. For any questions or comments about pod parsing and translatingissues and utilities, please use the pod-people@perl.org mailing list.For further information, please see L<Pod::Parser> and L<Pod::InputObjects>.=item Pod::Checker, podcheckerThis utility checks pod files for correct syntax, according toL<perlpod>. Obvious errors are flagged as such, while warnings areprinted for mistakes that can be handled gracefully. The checklist isnot complete yet. See L<Pod::Checker>.=item Pod::ParseUtils, Pod::FindThese modules provide a set of gizmos that are useful mainly for podtranslators. L<Pod::Find|Pod::Find> traverses directory structures andreturns found pod files, along with their canonical names (likeC<File::Spec::Unix>). L<Pod::ParseUtils|Pod::ParseUtils> containsB<Pod::List> (useful for storing pod list information), B<Pod::Hyperlink>(for parsing the contents of C<LE<lt>E<gt>> sequences) and B<Pod::Cache>(for caching information about pod files, e.g., link nodes).=item Pod::Select, podselectPod::Select is a subclass of Pod::Parser which provides a functionnamed "podselect()" to filter out user-specified sections of raw poddocumentation from an input stream. podselect is a script that providesaccess to Pod::Select from other scripts to be used as a filter.See L<Pod::Select>.=item Pod::Usage, pod2usagePod::Usage provides the function "pod2usage()" to print usage messages fora Perl script based on its embedded pod documentation. The pod2usage()function is generally useful to all script authors since it lets themwrite and maintain a single source (the pods) for documentation, thusremoving the need to create and maintain redundant usage message textconsisting of information already in the pods.There is also a pod2usage script which can be used from other kinds ofscripts to print usage messages from pods (even for non-Perl scriptswith pods embedded in comments).For details and examples, please see L<Pod::Usage>.=item Pod::Text and Pod::ManPod::Text has been rewritten to use Pod::Parser. While pod2text() isstill available for backwards compatibility, the module now has a newpreferred interface. See L<Pod::Text> for the details. The new Pod::Textmodule is easily subclassed for tweaks to the output, and two suchsubclasses (Pod::Text::Termcap for man-page-style bold and underliningusing termcap information, and Pod::Text::Color for markup with ANSI colorsequences) are now standard.pod2man has been turned into a module, Pod::Man, which also usesPod::Parser. In the process, several outstanding bugs related to quotesin section headers, quoting of code escapes, and nested lists have beenfixed. pod2man is now a wrapper script around this module.=item SDBM_FileAn EXISTS method has been added to this module (and sdbm_exists() hasbeen added to the underlying sdbm library), so one can now call existson an SDBM_File tied hash and get the correct result, rather than aruntime error.A bug that may have caused data loss when more than one disk blockhappens to be read from the database in a single FETCH() has beenfixed.=item Sys::SyslogSys::Syslog now uses XSUBs to access facilities from syslog.h so itno longer requires syslog.ph to exist. =item Sys::HostnameSys::Hostname now uses XSUBs to call the C library's gethostname() oruname() if they exist.=item Term::ANSIColorTerm::ANSIColor is a very simple module to provide easy and readableaccess to the ANSI color and highlighting escape sequences, supported bymost ANSI terminal emulators. It is now included standard.=item Time::LocalThe timelocal() and timegm() functions used to silently return bogusresults when the date fell outside the machine's integer range. Theynow consistently croak() if the date falls in an unsupported range.=item Win32The error return value in list context has been changed for all functionsthat return a list of values. Previously these functions returned a listwith a single element C<undef> if an error occurred. Now these functionsreturn the empty list in these situations. This applies to the followingfunctions: Win32::FsType Win32::GetOSVersionThe remaining functions are unchanged and continue to return C<undef> onerror even in list context.The Win32::SetLastError(ERROR) function has been added as a complementto the Win32::GetLastError() function.The new Win32::GetFullPathName(FILENAME) returns the full absolutepathname for FILENAME in scalar context. In list context it returnsa two-element list containing the fully qualified directory name andthe filename. See L<Win32>.=item XSLoaderThe XSLoader extension is a simpler alternative to DynaLoader.See L<XSLoader>.=item DBM FiltersA new feature called "DBM Filters" has been added to all theDBM modules--DB_File, GDBM_File, NDBM_File, ODBM_File, and SDBM_File.DBM Filters add four new methods to each DBM module: filter_store_key filter_store_value filter_fetch_key filter_fetch_valueThese can be used to filter key-value pairs before the pairs arewritten to the database or just after they are read from the database.See L<perldbmfilter> for further information.=back=head2 PragmataC<use attrs> is now obsolete, and is only provided forbackward-compatibility. It's been replaced by the C<sub : attributes>syntax. See L<perlsub/"Subroutine Attributes"> and L<attributes>.Lexical warnings pragma, C<use warnings;>, to control optional warnings.See L<perllexwarn>.C<use filetest> to control the behaviour of filetests (C<-r> C<-w>...). Currently only one subpragma implemented, "use filetest'access';", that uses access(2) or equivalent to check permissionsinstead of using stat(2) as usual. This matters in filesystemswhere there are ACLs (access control lists): the stat(2) might lie,but access(2) knows better.The C<open> pragma can be used to specify default disciplines forhandle constructors (e.g. open()) and for qx//. The twopseudo-disciplines C<:raw> and C<:crlf> are currently supported onDOS-derivative platforms (i.e. where binmode is not a no-op).See also L</"binmode() can be used to set :crlf and :raw modes">.=head1 Utility Changes=head2 dprofppC<dprofpp> is used to display profile data generated using C<Devel::DProf>.See L<dprofpp>.=head2 find2perlThe C<find2perl> utility now uses the enhanced features of the File::Findmodule. The -depth and -follow options are supported. Pod documentationis also included in the script.=head2 h2xsThe C<h2xs> tool can now work in conjunction with C<C::Scan> (availablefrom CPAN) to automatically parse real-life header files. The C<-M>,C<-a>, C<-k>, and C<-o> options are new.=head2 perlccC<perlcc> now supports the C and Bytecode backends. By default,it generates output from the simple C backend rather than theoptimized C backend.Support for non-Unix platforms has been improved.=head2 perldocC<perldoc> has been reworked to avoid possible security holes.It will not by default let itself be run as the superuser, but youmay still use the B<-U> switch to try to make it drop privilegesfirst.=head2 The Perl DebuggerMany bug fixes and enhancements were added to F<perl5db.pl>, thePerl debugger. The help documentation was rearranged. New commandsinclude C<< < ? >>, C<< > ? >>, and C<< { ? >> to list out currentactions, C<man I<docpage>> to run your doc viewer on some perldocset, and support for quoted options. The help information wasrearranged, and should be viewable once again if you're using B<less>as your pager. A serious security hole was plugged--you shouldimmediately remove all older versions of the Perl debugger asinstalled in previous releases, all the way back to perl3, fromyour system to avoid being bitten by this.=head1 Improved DocumentationMany of the platform-specific README files are now part of the perlinstallation. See L<perl> for the complete list.=over 4=item perlapi.podThe official list of public Perl API functions.=item perlboot.podA tutorial for beginners on object-oriented Perl.=item perlcompile.podAn introduction to using the Perl Compiler suite.=item perldbmfilter.podA howto document on using the DBM filter facility.=item perldebug.podAll material unrelated to running the Perl debugger, plus alllow-level guts-like details that risked crushing the casual userof the debugger, have been relocated from the old manpage to thenext entry below.=item perldebguts.podThis new manpage contains excessively low-level material not relatedto the Perl debugger, but slightly related to debugging Perl itself.It also contains some arcane internal details of how the debuggingprocess works that may only be of interest to developers of Perldebuggers.=item perlfork.podNotes on the fork() emulation currently available for the Windows platform.=item perlfilter.podAn introduction to writing Perl source filters.=item perlhack.podSome guidelines for hacking the Perl source code.=item perlintern.podA list of internal functions in the Perl source code.(List is currently empty.)=item perllexwarn.podIntroduction and reference information about lexically scopedwarning categories.=item perlnumber.podDetailed information about numbers as they are represented in Perl.=item perlopentut.podA tutorial on using open() effectively.=item perlreftut.podA tutorial that introduces the essentials of references.=item perltootc.podA tutorial on managing class data for object modules.=item perltodo.podDiscussion of the most often wanted features that may someday besupported in Perl.=item perlunicode.podAn introduction to Unicode support features in Perl.=back=head1 Performance enhancements=head2 Simple sort() using { $a <=> $b } and the like are optimizedMany common sort() operations using a simple inlined block are nowoptimized for faster performance.=head2 Optimized assignments to lexical variablesCertain operations in the RHS of assignment statements have beenoptimized to directly set the lexical variable on the LHS,eliminating redundant copying overheads.=head2 Faster subroutine callsMinor changes in how subroutine calls are handled internallyprovide marginal improvements in performance.=head2 delete(), each(), values() and hash iteration are fasterThe hash values returned by delete(), each(), values() and hashes in alist context are the actual values in the hash, instead of copies.This results in significantly better performance, because it eliminatesneedless copying in most situations.=head1 Installation and Configuration Improvements=head2 -Dusethreads means something differentThe -Dusethreads flag now enables the experimental interpreter-based threadsupport by default. To get the flavor of experimental threads that was in5.005 instead, you need to run Configure with "-Dusethreads -Duse5005threads".As of v5.6.0, interpreter-threads support is still lacking a way tocreate new threads from Perl (i.e., C<use Thread;> will not work with
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -