Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1029 lines
35 KiB

  1. =head1 NAME
  2. perldelta - what's new for perl5.005
  3. =head1 DESCRIPTION
  4. This document describes differences between the 5.004 release and this one.
  5. =head1 About the new versioning system
  6. Perl is now developed on two tracks: a maintenance track that makes
  7. small, safe updates to released production versions with emphasis on
  8. compatibility; and a development track that pursues more aggressive
  9. evolution. Maintenance releases (which should be considered production
  10. quality) have subversion numbers that run from C<1> to C<49>, and
  11. development releases (which should be considered "alpha" quality) run
  12. from C<50> to C<99>.
  13. Perl 5.005 is the combined product of the new dual-track development
  14. scheme.
  15. =head1 Incompatible Changes
  16. =head2 WARNING: This version is not binary compatible with Perl 5.004.
  17. Starting with Perl 5.004_50 there were many deep and far-reaching changes
  18. to the language internals. If you have dynamically loaded extensions
  19. that you built under perl 5.003 or 5.004, you can continue to use them
  20. with 5.004, but you will need to rebuild and reinstall those extensions
  21. to use them 5.005. See L<INSTALL> for detailed instructions on how to
  22. upgrade.
  23. =head2 Default installation structure has changed
  24. The new Configure defaults are designed to allow a smooth upgrade from
  25. 5.004 to 5.005, but you should read L<INSTALL> for a detailed
  26. discussion of the changes in order to adapt them to your system.
  27. =head2 Perl Source Compatibility
  28. When none of the experimental features are enabled, there should be
  29. very few user-visible Perl source compatibility issues.
  30. If threads are enabled, then some caveats apply. C<@_> and C<$_> become
  31. lexical variables. The effect of this should be largely transparent to
  32. the user, but there are some boundary conditions under which user will
  33. need to be aware of the issues. For example, C<local(@_)> results in
  34. a "Can't localize lexical variable @_ ..." message. This may be enabled
  35. in a future version.
  36. Some new keywords have been introduced. These are generally expected to
  37. have very little impact on compatibility. See L<New C<INIT> keyword>,
  38. L<New C<lock> keyword>, and L<New C<qr//> operator>.
  39. Certain barewords are now reserved. Use of these will provoke a warning
  40. if you have asked for them with the C<-w> switch.
  41. See L<C<our> is now a reserved word>.
  42. =head2 C Source Compatibility
  43. There have been a large number of changes in the internals to support
  44. the new features in this release.
  45. =over 4
  46. =item Core sources now require ANSI C compiler
  47. An ANSI C compiler is now B<required> to build perl. See F<INSTALL>.
  48. =item All Perl global variables must now be referenced with an explicit prefix
  49. All Perl global variables that are visible for use by extensions now
  50. have a C<PL_> prefix. New extensions should C<not> refer to perl globals
  51. by their unqualified names. To preserve sanity, we provide limited
  52. backward compatibility for globals that are being widely used like
  53. C<sv_undef> and C<na> (which should now be written as C<PL_sv_undef>,
  54. C<PL_na> etc.)
  55. If you find that your XS extension does not compile anymore because a
  56. perl global is not visible, try adding a C<PL_> prefix to the global
  57. and rebuild.
  58. It is strongly recommended that all functions in the Perl API that don't
  59. begin with C<perl> be referenced with a C<Perl_> prefix. The bare function
  60. names without the C<Perl_> prefix are supported with macros, but this
  61. support may cease in a future release.
  62. See L<perlguts/"API LISTING">.
  63. =item Enabling threads has source compatibility issues
  64. Perl built with threading enabled requires extensions to use the new
  65. C<dTHR> macro to initialize the handle to access per-thread data.
  66. If you see a compiler error that talks about the variable C<thr> not
  67. being declared (when building a module that has XS code), you need
  68. to add C<dTHR;> at the beginning of the block that elicited the error.
  69. The API function C<perl_get_sv("@",FALSE)> should be used instead of
  70. directly accessing perl globals as C<GvSV(errgv)>. The API call is
  71. backward compatible with existing perls and provides source compatibility
  72. with threading is enabled.
  73. See L<"C Source Compatibility"> for more information.
  74. =back
  75. =head2 Binary Compatibility
  76. This version is NOT binary compatible with older versions. All extensions
  77. will need to be recompiled. Further binaries built with threads enabled
  78. are incompatible with binaries built without. This should largely be
  79. transparent to the user, as all binary incompatible configurations have
  80. their own unique architecture name, and extension binaries get installed at
  81. unique locations. This allows coexistence of several configurations in
  82. the same directory hierarchy. See F<INSTALL>.
  83. =head2 Security fixes may affect compatibility
  84. A few taint leaks and taint omissions have been corrected. This may lead
  85. to "failure" of scripts that used to work with older versions. Compiling
  86. with -DINCOMPLETE_TAINTS provides a perl with minimal amounts of changes
  87. to the tainting behavior. But note that the resulting perl will have
  88. known insecurities.
  89. Oneliners with the C<-e> switch do not create temporary files anymore.
  90. =head2 Relaxed new mandatory warnings introduced in 5.004
  91. Many new warnings that were introduced in 5.004 have been made
  92. optional. Some of these warnings are still present, but perl's new
  93. features make them less often a problem. See L<New Diagnostics>.
  94. =head2 Licensing
  95. Perl has a new Social Contract for contributors. See F<Porting/Contract>.
  96. The license included in much of the Perl documentation has changed.
  97. Most of the Perl documentation was previously under the implicit GNU
  98. General Public License or the Artistic License (at the user's choice).
  99. Now much of the documentation unambigously states the terms under which
  100. it may be distributed. Those terms are in general much less restrictive
  101. than the GNU GPL. See L<perl> and the individual perl man pages listed
  102. therein.
  103. =head1 Core Changes
  104. =head2 Threads
  105. WARNING: Threading is considered an B<experimental> feature. Details of the
  106. implementation may change without notice. There are known limitations
  107. and some bugs. These are expected to be fixed in future versions.
  108. See L<README.threads>.
  109. Mach cthreads (NEXTSTEP, OPENSTEP, Rhapsody) are now supported by
  110. the Thread extension.
  111. =head2 Compiler
  112. WARNING: The Compiler and related tools are considered B<experimental>.
  113. Features may change without notice, and there are known limitations
  114. and bugs. Since the compiler is fully external to perl, the default
  115. configuration will build and install it.
  116. The Compiler produces three different types of transformations of a
  117. perl program. The C backend generates C code that captures perl's state
  118. just before execution begins. It eliminates the compile-time overheads
  119. of the regular perl interpreter, but the run-time performance remains
  120. comparatively the same. The CC backend generates optimized C code
  121. equivalent to the code path at run-time. The CC backend has greater
  122. potential for big optimizations, but only a few optimizations are
  123. implemented currently. The Bytecode backend generates a platform
  124. independent bytecode representation of the interpreter's state
  125. just before execution. Thus, the Bytecode back end also eliminates
  126. much of the compilation overhead of the interpreter.
  127. The compiler comes with several valuable utilities.
  128. C<B::Lint> is an experimental module to detect and warn about suspicious
  129. code, especially the cases that the C<-w> switch does not detect.
  130. C<B::Deparse> can be used to demystify perl code, and understand
  131. how perl optimizes certain constructs.
  132. C<B::Xref> generates cross reference reports of all definition and use
  133. of variables, subroutines and formats in a program.
  134. C<B::Showlex> show the lexical variables used by a subroutine or file
  135. at a glance.
  136. C<perlcc> is a simple frontend for compiling perl.
  137. See C<ext/B/README>, L<B>, and the respective compiler modules.
  138. =head2 Regular Expressions
  139. Perl's regular expression engine has been seriously overhauled, and
  140. many new constructs are supported. Several bugs have been fixed.
  141. Here is an itemized summary:
  142. =over 4
  143. =item Many new and improved optimizations
  144. Changes in the RE engine:
  145. Unneeded nodes removed;
  146. Substrings merged together;
  147. New types of nodes to process (SUBEXPR)* and similar expressions
  148. quickly, used if the SUBEXPR has no side effects and matches
  149. strings of the same length;
  150. Better optimizations by lookup for constant substrings;
  151. Better search for constants substrings anchored by $ ;
  152. Changes in Perl code using RE engine:
  153. More optimizations to s/longer/short/;
  154. study() was not working;
  155. /blah/ may be optimized to an analogue of index() if $& $` $' not seen;
  156. Unneeded copying of matched-against string removed;
  157. Only matched part of the string is copying if $` $' were not seen;
  158. =item Many bug fixes
  159. Note that only the major bug fixes are listed here. See F<Changes> for others.
  160. Backtracking might not restore start of $3.
  161. No feedback if max count for * or + on "complex" subexpression
  162. was reached, similarly (but at compile time) for {3,34567}
  163. Primitive restrictions on max count introduced to decrease a
  164. possibility of a segfault;
  165. (ZERO-LENGTH)* could segfault;
  166. (ZERO-LENGTH)* was prohibited;
  167. Long REs were not allowed;
  168. /RE/g could skip matches at the same position after a
  169. zero-length match;
  170. =item New regular expression constructs
  171. The following new syntax elements are supported:
  172. (?<=RE)
  173. (?<!RE)
  174. (?{ CODE })
  175. (?i-x)
  176. (?i:RE)
  177. (?(COND)YES_RE|NO_RE)
  178. (?>RE)
  179. \z
  180. =item New operator for precompiled regular expressions
  181. See L<New C<qr//> operator>.
  182. =item Other improvements
  183. Better debugging output (possibly with colors),
  184. even from non-debugging Perl;
  185. RE engine code now looks like C, not like assembler;
  186. Behaviour of RE modifiable by `use re' directive;
  187. Improved documentation;
  188. Test suite significantly extended;
  189. Syntax [:^upper:] etc., reserved inside character classes;
  190. =item Incompatible changes
  191. (?i) localized inside enclosing group;
  192. $( is not interpolated into RE any more;
  193. /RE/g may match at the same position (with non-zero length)
  194. after a zero-length match (bug fix).
  195. =back
  196. See L<perlre> and L<perlop>.
  197. =head2 Improved malloc()
  198. See banner at the beginning of C<malloc.c> for details.
  199. =head2 Quicksort is internally implemented
  200. Perl now contains its own highly optimized qsort() routine. The new qsort()
  201. is resistant to inconsistent comparison functions, so Perl's C<sort()> will
  202. not provoke coredumps any more when given poorly written sort subroutines.
  203. (Some C library C<qsort()>s that were being used before used to have this
  204. problem.) In our testing, the new C<qsort()> required the minimal number
  205. of pair-wise compares on average, among all known C<qsort()> implementations.
  206. See C<perlfunc/sort>.
  207. =head2 Reliable signals
  208. Perl's signal handling is susceptible to random crashes, because signals
  209. arrive asynchronously, and the Perl runtime is not reentrant at arbitrary
  210. times.
  211. However, one experimental implementation of reliable signals is available
  212. when threads are enabled. See C<Thread::Signal>. Also see F<INSTALL> for
  213. how to build a Perl capable of threads.
  214. =head2 Reliable stack pointers
  215. The internals now reallocate the perl stack only at predictable times.
  216. In particular, magic calls never trigger reallocations of the stack,
  217. because all reentrancy of the runtime is handled using a "stack of stacks".
  218. This should improve reliability of cached stack pointers in the internals
  219. and in XSUBs.
  220. =head2 More generous treatment of carriage returns
  221. Perl used to complain if it encountered literal carriage returns in
  222. scripts. Now they are mostly treated like whitespace within program text.
  223. Inside string literals and here documents, literal carriage returns are
  224. ignored if they occur paired with linefeeds, or get interpreted as whitespace
  225. if they stand alone. This behavior means that literal carriage returns
  226. in files should be avoided. You can get the older, more compatible (but
  227. less generous) behavior by defining the preprocessor symbol
  228. C<PERL_STRICT_CR> when building perl. Of course, all this has nothing
  229. whatever to do with how escapes like C<\r> are handled within strings.
  230. Note that this doesn't somehow magically allow you to keep all text files
  231. in DOS format. The generous treatment only applies to files that perl
  232. itself parses. If your C compiler doesn't allow carriage returns in
  233. files, you may still be unable to build modules that need a C compiler.
  234. =head2 Memory leaks
  235. C<substr>, C<pos> and C<vec> don't leak memory anymore when used in lvalue
  236. context. Many small leaks that impacted applications that embed multiple
  237. interpreters have been fixed.
  238. =head2 Better support for multiple interpreters
  239. The build-time option C<-DMULTIPLICITY> has had many of the details
  240. reworked. Some previously global variables that should have been
  241. per-interpreter now are. With care, this allows interpreters to call
  242. each other. See the C<PerlInterp> extension on CPAN.
  243. =head2 Behavior of local() on array and hash elements is now well-defined
  244. See L<perlsub/"Temporary Values via local()">.
  245. =head2 C<%!> is transparently tied to the L<Errno> module
  246. See L<perlvar>, and L<Errno>.
  247. =head2 Pseudo-hashes are supported
  248. See L<perlref>.
  249. =head2 C<EXPR foreach EXPR> is supported
  250. See L<perlsyn>.
  251. =head2 Keywords can be globally overridden
  252. See L<perlsub>.
  253. =head2 C<$^E> is meaningful on Win32
  254. See L<perlvar>.
  255. =head2 C<foreach (1..1000000)> optimized
  256. C<foreach (1..1000000)> is now optimized into a counting loop. It does
  257. not try to allocate a 1000000-size list anymore.
  258. =head2 C<Foo::> can be used as implicitly quoted package name
  259. Barewords caused unintuitive behavior when a subroutine with the same
  260. name as a package happened to be defined. Thus, C<new Foo @args>,
  261. use the result of the call to C<Foo()> instead of C<Foo> being treated
  262. as a literal. The recommended way to write barewords in the indirect
  263. object slot is C<new Foo:: @args>. Note that the method C<new()> is
  264. called with a first argument of C<Foo>, not C<Foo::> when you do that.
  265. =head2 C<exists $Foo::{Bar::}> tests existence of a package
  266. It was impossible to test for the existence of a package without
  267. actually creating it before. Now C<exists $Foo::{Bar::}> can be
  268. used to test if the C<Foo::Bar> namespace has been created.
  269. =head2 Better locale support
  270. See L<perllocale>.
  271. =head2 Experimental support for 64-bit platforms
  272. Perl5 has always had 64-bit support on systems with 64-bit longs.
  273. Starting with 5.005, the beginnings of experimental support for systems
  274. with 32-bit long and 64-bit 'long long' integers has been added.
  275. If you add -DUSE_LONG_LONG to your ccflags in config.sh (or manually
  276. define it in perl.h) then perl will be built with 'long long' support.
  277. There will be many compiler warnings, and the resultant perl may not
  278. work on all systems. There are many other issues related to
  279. third-party extensions and libraries. This option exists to allow
  280. people to work on those issues.
  281. =head2 prototype() returns useful results on builtins
  282. See L<perlfunc/prototype>.
  283. =head2 Extended support for exception handling
  284. C<die()> now accepts a reference value, and C<$@> gets set to that
  285. value in exception traps. This makes it possible to propagate
  286. exception objects. This is an undocumented B<experimental> feature.
  287. =head2 Re-blessing in DESTROY() supported for chaining DESTROY() methods
  288. See L<perlobj/Destructors>.
  289. =head2 All C<printf> format conversions are handled internally
  290. See L<perlfunc/printf>.
  291. =head2 New C<INIT> keyword
  292. C<INIT> subs are like C<BEGIN> and C<END>, but they get run just before
  293. the perl runtime begins execution. e.g., the Perl Compiler makes use of
  294. C<INIT> blocks to initialize and resolve pointers to XSUBs.
  295. =head2 New C<lock> keyword
  296. The C<lock> keyword is the fundamental synchronization primitive
  297. in threaded perl. When threads are not enabled, it is currently a noop.
  298. To minimize impact on source compatibility this keyword is "weak", i.e., any
  299. user-defined subroutine of the same name overrides it, unless a C<use Thread>
  300. has been seen.
  301. =head2 New C<qr//> operator
  302. The C<qr//> operator, which is syntactically similar to the other quote-like
  303. operators, is used to create precompiled regular expressions. This compiled
  304. form can now be explicitly passed around in variables, and interpolated in
  305. other regular expressions. See L<perlop>.
  306. =head2 C<our> is now a reserved word
  307. Calling a subroutine with the name C<our> will now provoke a warning when
  308. using the C<-w> switch.
  309. =head2 Tied arrays are now fully supported
  310. See L<Tie::Array>.
  311. =head2 Tied handles support is better
  312. Several missing hooks have been added. There is also a new base class for
  313. TIEARRAY implementations. See L<Tie::Array>.
  314. =head2 4th argument to substr
  315. substr() can now both return and replace in one operation. The optional
  316. 4th argument is the replacement string. See L<perlfunc/substr>.
  317. =head2 Negative LENGTH argument to splice
  318. splice() with a negative LENGTH argument now work similar to what the
  319. LENGTH did for substr(). Previously a negative LENGTH was treated as
  320. 0. See L<perlfunc/splice>.
  321. =head2 Magic lvalues are now more magical
  322. When you say something like C<substr($x, 5) = "hi">, the scalar returned
  323. by substr() is special, in that any modifications to it affect $x.
  324. (This is called a 'magic lvalue' because an 'lvalue' is something on
  325. the left side of an assignment.) Normally, this is exactly what you
  326. would expect to happen, but Perl uses the same magic if you use substr(),
  327. pos(), or vec() in a context where they might be modified, like taking
  328. a reference with C<\> or as an argument to a sub that modifies C<@_>.
  329. In previous versions, this 'magic' only went one way, but now changes
  330. to the scalar the magic refers to ($x in the above example) affect the
  331. magic lvalue too. For instance, this code now acts differently:
  332. $x = "hello";
  333. sub printit {
  334. $x = "g'bye";
  335. print $_[0], "\n";
  336. }
  337. printit(substr($x, 0, 5));
  338. In previous versions, this would print "hello", but it now prints "g'bye".
  339. =head2 E<lt>E<gt> now reads in records
  340. If C<$/> is a referenence to an integer, or a scalar that holds an integer,
  341. E<lt>E<gt> will read in records instead of lines. For more info, see
  342. L<perlvar/$/>.
  343. =head2 pack() format 'Z' supported
  344. The new format type 'Z' is useful for packing and unpacking null-terminated
  345. strings. See L<perlfunc/"pack">.
  346. =head1 Significant bug fixes
  347. =head2 E<lt>HANDLEE<gt> on empty files
  348. With C<$/> set to C<undef>, slurping an empty file returns a string of
  349. zero length (instead of C<undef>, as it used to) for the first time the
  350. HANDLE is read. Subsequent reads yield C<undef>.
  351. This means that the following will append "foo" to an empty file (it used
  352. to not do anything before):
  353. perl -0777 -pi -e 's/^/foo/' empty_file
  354. Note that the behavior of:
  355. perl -pi -e 's/^/foo/' empty_file
  356. is unchanged (it continues to leave the file empty).
  357. =head1 Supported Platforms
  358. Configure has many incremental improvements. Site-wide policy for building
  359. perl can now be made persistent, via Policy.sh. Configure also records
  360. the command-line arguments used in F<config.sh>.
  361. =head2 New Platforms
  362. BeOS is now supported. See L<README.beos>.
  363. DOS is now supported under the DJGPP tools. See L<README.dos>.
  364. GNU/Hurd is now supported.
  365. MiNT is now supported. See L<README.mint>.
  366. MPE/iX is now supported. See L<README.mpeix>.
  367. MVS (aka OS390, aka Open Edition) is now supported. See L<README.os390>.
  368. Stratus VOS is now supported. See L<README.vos>.
  369. =head2 Changes in existing support
  370. Win32 support has been vastly enhanced. Support for Perl Object, a C++
  371. encapsulation of Perl. GCC and EGCS are now supported on Win32.
  372. See F<README.win32>, aka L<perlwin32>.
  373. VMS configuration system has been rewritten. See L<README.vms>.
  374. The hints files for most Unix platforms have seen incremental improvements.
  375. =head1 Modules and Pragmata
  376. =head2 New Modules
  377. =over
  378. =item B
  379. Perl compiler and tools. See L<B>.
  380. =item Data::Dumper
  381. A module to pretty print Perl data. See L<Data::Dumper>.
  382. =item Dumpvalue
  383. A module to dump perl values to the screen. See L<Dumpvalue>.
  384. =item Errno
  385. A module to look up errors more conveniently. See L<Errno>.
  386. =item File::Spec
  387. A portable API for file operations.
  388. =item ExtUtils::Installed
  389. Query and manage installed modules.
  390. =item ExtUtils::Packlist
  391. Manipulate .packlist files.
  392. =item Fatal
  393. Make functions/builtins succeed or die.
  394. =item IPC::SysV
  395. Constants and other support infrastructure for System V IPC operations
  396. in perl.
  397. =item Test
  398. A framework for writing testsuites.
  399. =item Tie::Array
  400. Base class for tied arrays.
  401. =item Tie::Handle
  402. Base class for tied handles.
  403. =item Thread
  404. Perl thread creation, manipulation, and support.
  405. =item attrs
  406. Set subroutine attributes.
  407. =item fields
  408. Compile-time class fields.
  409. =item re
  410. Various pragmata to control behavior of regular expressions.
  411. =back
  412. =head2 Changes in existing modules
  413. =over
  414. =item Benchmark
  415. You can now run tests for I<n> seconds instead of guessing the right
  416. number of tests to run: e.g. timethese(-5, ...) will run each of the
  417. codes for at least 5 CPU seconds. Zero as the "number of repetitions"
  418. means "for at least 3 CPU seconds". The output format has also
  419. changed. For example:
  420. use Benchmark;$x=3;timethese(-5,{a=>sub{$x*$x},b=>sub{$x**2}})
  421. will now output something like this:
  422. Benchmark: running a, b, each for at least 5 CPU seconds...
  423. a: 5 wallclock secs ( 5.77 usr + 0.00 sys = 5.77 CPU) @ 200551.91/s (n=1156516)
  424. b: 4 wallclock secs ( 5.00 usr + 0.02 sys = 5.02 CPU) @ 159605.18/s (n=800686)
  425. New features: "each for at least N CPU seconds...", "wallclock secs",
  426. and the "@ operations/CPU second (n=operations)".
  427. =item Carp
  428. Carp has a new function cluck(). cluck() warns, like carp(), but also adds
  429. a stack backtrace to the error message, like confess().
  430. =item CGI
  431. CGI has been updated to version 2.42.
  432. =item Fcntl
  433. More Fcntl constants added: F_SETLK64, F_SETLKW64, O_LARGEFILE for
  434. large (more than 4G) file access (the 64-bit support is not yet
  435. working, though, so no need to get overly excited), Free/Net/OpenBSD
  436. locking behaviour flags F_FLOCK, F_POSIX, Linux F_SHLCK, and
  437. O_ACCMODE: the mask of O_RDONLY, O_WRONLY, and O_RDWR.
  438. =item Math::Complex
  439. The accessor methods Re, Im, arg, abs, rho, and theta, can now also
  440. act as mutators (accessor $z->Re(), mutator $z->Re(3)).
  441. =item Math::Trig
  442. A little bit of radial trigonometry (cylindrical and spherical) added:
  443. radial coordinate conversions and the great circle distance.
  444. =item POSIX
  445. POSIX now has its own platform-specific hints files.
  446. =item DB_File
  447. DB_File supports version 2.x of Berkeley DB. See C<ext/DB_File/Changes>.
  448. =item MakeMaker
  449. MakeMaker now supports writing empty makefiles, provides a way to
  450. specify that site umask() policy should be honored. There is also
  451. better support for manipulation of .packlist files, and getting
  452. information about installed modules.
  453. Extensions that have both architecture-dependent and
  454. architecture-independent files are now always installed completely in
  455. the architecture-dependent locations. Previously, the shareable parts
  456. were shared both across architectures and across perl versions and were
  457. therefore liable to be overwritten with newer versions that might have
  458. subtle incompatibilities.
  459. =item CPAN
  460. See <perlmodinstall> and L<CPAN>.
  461. =item Cwd
  462. Cwd::cwd is faster on most platforms.
  463. =item Benchmark
  464. Keeps better time.
  465. =back
  466. =head1 Utility Changes
  467. C<h2ph> and related utilities have been vastly overhauled.
  468. C<perlcc>, a new experimental front end for the compiler is available.
  469. The crude GNU C<configure> emulator is now called C<configure.gnu> to
  470. avoid trampling on C<Configure> under case-insensitive filesystems.
  471. C<perldoc> used to be rather slow. The slower features are now optional.
  472. In particular, case-insensitive searches need the C<-i> switch, and
  473. recursive searches need C<-r>. You can set these switches in the
  474. C<PERLDOC> environment variable to get the old behavior.
  475. =head1 Documentation Changes
  476. Config.pm now has a glossary of variables.
  477. F<Porting/patching.pod> has detailed instructions on how to create and
  478. submit patches for perl.
  479. L<perlport> specifies guidelines on how to write portably.
  480. L<perlmodinstall> describes how to fetch and install modules from C<CPAN>
  481. sites.
  482. Some more Perl traps are documented now. See L<perltrap>.
  483. L<perlopentut> gives a tutorial on using open().
  484. L<perlreftut> gives a tutorial on references.
  485. L<perlthrtut> gives a tutorial on threads.
  486. =head1 New Diagnostics
  487. =over
  488. =item Ambiguous call resolved as CORE::%s(), qualify as such or use &
  489. (W) A subroutine you have declared has the same name as a Perl keyword,
  490. and you have used the name without qualification for calling one or the
  491. other. Perl decided to call the builtin because the subroutine is
  492. not imported.
  493. To force interpretation as a subroutine call, either put an ampersand
  494. before the subroutine name, or qualify the name with its package.
  495. Alternatively, you can import the subroutine (or pretend that it's
  496. imported with the C<use subs> pragma).
  497. To silently interpret it as the Perl operator, use the C<CORE::> prefix
  498. on the operator (e.g. C<CORE::log($x)>) or by declaring the subroutine
  499. to be an object method (see L<attrs>).
  500. =item Bad index while coercing array into hash
  501. (F) The index looked up in the hash found as the 0'th element of a
  502. pseudo-hash is not legal. Index values must be at 1 or greater.
  503. See L<perlref>.
  504. =item Bareword "%s" refers to nonexistent package
  505. (W) You used a qualified bareword of the form C<Foo::>, but
  506. the compiler saw no other uses of that namespace before that point.
  507. Perhaps you need to predeclare a package?
  508. =item Can't call method "%s" on an undefined value
  509. (F) You used the syntax of a method call, but the slot filled by the
  510. object reference or package name contains an undefined value.
  511. Something like this will reproduce the error:
  512. $BADREF = 42;
  513. process $BADREF 1,2,3;
  514. $BADREF->process(1,2,3);
  515. =item Can't check filesystem of script "%s" for nosuid
  516. (P) For some reason you can't check the filesystem of the script for nosuid.
  517. =item Can't coerce array into hash
  518. (F) You used an array where a hash was expected, but the array has no
  519. information on how to map from keys to array indices. You can do that
  520. only with arrays that have a hash reference at index 0.
  521. =item Can't goto subroutine from an eval-string
  522. (F) The "goto subroutine" call can't be used to jump out of an eval "string".
  523. (You can use it to jump out of an eval {BLOCK}, but you probably don't want to.)
  524. =item Can't localize pseudo-hash element
  525. (F) You said something like C<local $ar-E<gt>{'key'}>, where $ar is
  526. a reference to a pseudo-hash. That hasn't been implemented yet, but
  527. you can get a similar effect by localizing the corresponding array
  528. element directly -- C<local $ar-E<gt>[$ar-E<gt>[0]{'key'}]>.
  529. =item Can't use %%! because Errno.pm is not available
  530. (F) The first time the %! hash is used, perl automatically loads the
  531. Errno.pm module. The Errno module is expected to tie the %! hash to
  532. provide symbolic names for C<$!> errno values.
  533. =item Cannot find an opnumber for "%s"
  534. (F) A string of a form C<CORE::word> was given to prototype(), but
  535. there is no builtin with the name C<word>.
  536. =item Character class syntax [. .] is reserved for future extensions
  537. (W) Within regular expression character classes ([]) the syntax beginning
  538. with "[." and ending with ".]" is reserved for future extensions.
  539. If you need to represent those character sequences inside a regular
  540. expression character class, just quote the square brackets with the
  541. backslash: "\[." and ".\]".
  542. =item Character class syntax [: :] is reserved for future extensions
  543. (W) Within regular expression character classes ([]) the syntax beginning
  544. with "[:" and ending with ":]" is reserved for future extensions.
  545. If you need to represent those character sequences inside a regular
  546. expression character class, just quote the square brackets with the
  547. backslash: "\[:" and ":\]".
  548. =item Character class syntax [= =] is reserved for future extensions
  549. (W) Within regular expression character classes ([]) the syntax
  550. beginning with "[=" and ending with "=]" is reserved for future extensions.
  551. If you need to represent those character sequences inside a regular
  552. expression character class, just quote the square brackets with the
  553. backslash: "\[=" and "=\]".
  554. =item %s: Eval-group in insecure regular expression
  555. (F) Perl detected tainted data when trying to compile a regular expression
  556. that contains the C<(?{ ... })> zero-width assertion, which is unsafe.
  557. See L<perlre/(?{ code })>, and L<perlsec>.
  558. =item %s: Eval-group not allowed, use re 'eval'
  559. (F) A regular expression contained the C<(?{ ... })> zero-width assertion,
  560. but that construct is only allowed when the C<use re 'eval'> pragma is
  561. in effect. See L<perlre/(?{ code })>.
  562. =item %s: Eval-group not allowed at run time
  563. (F) Perl tried to compile a regular expression containing the C<(?{ ... })>
  564. zero-width assertion at run time, as it would when the pattern contains
  565. interpolated values. Since that is a security risk, it is not allowed.
  566. If you insist, you may still do this by explicitly building the pattern
  567. from an interpolated string at run time and using that in an eval().
  568. See L<perlre/(?{ code })>.
  569. =item Explicit blessing to '' (assuming package main)
  570. (W) You are blessing a reference to a zero length string. This has
  571. the effect of blessing the reference into the package main. This is
  572. usually not what you want. Consider providing a default target
  573. package, e.g. bless($ref, $p || 'MyPackage');
  574. =item Illegal hex digit ignored
  575. (W) You may have tried to use a character other than 0 - 9 or A - F in a
  576. hexadecimal number. Interpretation of the hexadecimal number stopped
  577. before the illegal character.
  578. =item No such array field
  579. (F) You tried to access an array as a hash, but the field name used is
  580. not defined. The hash at index 0 should map all valid field names to
  581. array indices for that to work.
  582. =item No such field "%s" in variable %s of type %s
  583. (F) You tried to access a field of a typed variable where the type
  584. does not know about the field name. The field names are looked up in
  585. the %FIELDS hash in the type package at compile time. The %FIELDS hash
  586. is usually set up with the 'fields' pragma.
  587. =item Out of memory during ridiculously large request
  588. (F) You can't allocate more than 2^31+"small amount" bytes. This error
  589. is most likely to be caused by a typo in the Perl program. e.g., C<$arr[time]>
  590. instead of C<$arr[$time]>.
  591. =item Range iterator outside integer range
  592. (F) One (or both) of the numeric arguments to the range operator ".."
  593. are outside the range which can be represented by integers internally.
  594. One possible workaround is to force Perl to use magical string
  595. increment by prepending "0" to your numbers.
  596. =item Recursive inheritance detected while looking for method '%s' in package '%s'
  597. (F) More than 100 levels of inheritance were encountered while invoking a
  598. method. Probably indicates an unintended loop in your inheritance hierarchy.
  599. =item Reference found where even-sized list expected
  600. (W) You gave a single reference where Perl was expecting a list with
  601. an even number of elements (for assignment to a hash). This
  602. usually means that you used the anon hash constructor when you meant
  603. to use parens. In any case, a hash requires key/value B<pairs>.
  604. %hash = { one => 1, two => 2, }; # WRONG
  605. %hash = [ qw/ an anon array / ]; # WRONG
  606. %hash = ( one => 1, two => 2, ); # right
  607. %hash = qw( one 1 two 2 ); # also fine
  608. =item Undefined value assigned to typeglob
  609. (W) An undefined value was assigned to a typeglob, a la C<*foo = undef>.
  610. This does nothing. It's possible that you really mean C<undef *foo>.
  611. =item Use of reserved word "%s" is deprecated
  612. (D) The indicated bareword is a reserved word. Future versions of perl
  613. may use it as a keyword, so you're better off either explicitly quoting
  614. the word in a manner appropriate for its context of use, or using a
  615. different name altogether. The warning can be suppressed for subroutine
  616. names by either adding a C<&> prefix, or using a package qualifier,
  617. e.g. C<&our()>, or C<Foo::our()>.
  618. =item perl: warning: Setting locale failed.
  619. (S) The whole warning message will look something like:
  620. perl: warning: Setting locale failed.
  621. perl: warning: Please check that your locale settings:
  622. LC_ALL = "En_US",
  623. LANG = (unset)
  624. are supported and installed on your system.
  625. perl: warning: Falling back to the standard locale ("C").
  626. Exactly what were the failed locale settings varies. In the above the
  627. settings were that the LC_ALL was "En_US" and the LANG had no value.
  628. This error means that Perl detected that you and/or your system
  629. administrator have set up the so-called variable system but Perl could
  630. not use those settings. This was not dead serious, fortunately: there
  631. is a "default locale" called "C" that Perl can and will use, the
  632. script will be run. Before you really fix the problem, however, you
  633. will get the same error message each time you run Perl. How to really
  634. fix the problem can be found in L<perllocale/"LOCALE PROBLEMS">.
  635. =back
  636. =head1 Obsolete Diagnostics
  637. =over
  638. =item Can't mktemp()
  639. (F) The mktemp() routine failed for some reason while trying to process
  640. a B<-e> switch. Maybe your /tmp partition is full, or clobbered.
  641. Removed because B<-e> doesn't use temporary files any more.
  642. =item Can't write to temp file for B<-e>: %s
  643. (F) The write routine failed for some reason while trying to process
  644. a B<-e> switch. Maybe your /tmp partition is full, or clobbered.
  645. Removed because B<-e> doesn't use temporary files any more.
  646. =item Cannot open temporary file
  647. (F) The create routine failed for some reason while trying to process
  648. a B<-e> switch. Maybe your /tmp partition is full, or clobbered.
  649. Removed because B<-e> doesn't use temporary files any more.
  650. =item regexp too big
  651. (F) The current implementation of regular expressions uses shorts as
  652. address offsets within a string. Unfortunately this means that if
  653. the regular expression compiles to longer than 32767, it'll blow up.
  654. Usually when you want a regular expression this big, there is a better
  655. way to do it with multiple statements. See L<perlre>.
  656. =back
  657. =head1 Configuration Changes
  658. You can use "Configure -Uinstallusrbinperl" which causes installperl
  659. to skip installing perl also as /usr/bin/perl. This is useful if you
  660. prefer not to modify /usr/bin for some reason or another but harmful
  661. because many scripts assume to find Perl in /usr/bin/perl.
  662. =head1 BUGS
  663. If you find what you think is a bug, you might check the headers of
  664. recently posted articles in the comp.lang.perl.misc newsgroup.
  665. There may also be information at http://www.perl.com/perl/, the Perl
  666. Home Page.
  667. If you believe you have an unreported bug, please run the B<perlbug>
  668. program included with your release. Make sure you trim your bug down
  669. to a tiny but sufficient test case. Your bug report, along with the
  670. output of C<perl -V>, will be sent off to <F<[email protected]>> to be
  671. analysed by the Perl porting team.
  672. =head1 SEE ALSO
  673. The F<Changes> file for exhaustive details on what changed.
  674. The F<INSTALL> file for how to build Perl.
  675. The F<README> file for general stuff.
  676. The F<Artistic> and F<Copying> files for copyright information.
  677. =head1 HISTORY
  678. Written by Gurusamy Sarathy <F<[email protected]>>, with many contributions
  679. from The Perl Porters.
  680. Send omissions or corrections to <F<[email protected]>>.
  681. =cut