Commit | Line | Data |
ba8251e8 |
1 | =head1 NAME |
2 | |
a5222a85 |
3 | perldelta - what's new for perl v5.6 (as of v5.005_62) |
ba8251e8 |
4 | |
5 | =head1 DESCRIPTION |
6 | |
f29c64d6 |
7 | This is an unsupported alpha release, meant for intrepid Perl developers |
8 | only. The included sources may not even build correctly on some platforms. |
9 | Subscribing to perl5-porters is the best way to monitor and contribute |
10 | to the progress of development releases (see www.perl.org for info). |
11 | |
ba8251e8 |
12 | This document describes differences between the 5.005 release and this one. |
13 | |
14 | =head1 Incompatible Changes |
15 | |
e02fdbd2 |
16 | =head2 Perl Source Incompatibilities |
17 | |
a5222a85 |
18 | Beware that any new warnings that have been added are B<not> considered |
19 | incompatible changes. |
20 | |
21 | Since all new warnings must be explicitly requested via the C<-w> |
22 | switch or the C<warnings> pragma, it is ultimately the programmer's |
23 | responsibility to ensure that warnings are enabled judiciously. |
e02fdbd2 |
24 | |
757edf6f |
25 | =over 4 |
26 | |
27 | =item Possibly changed pseudo-random number generator |
28 | |
29 | In 5.005_0x and earlier, perl's rand() function used the C library |
30 | rand(3) function. As of 5.005_52, Configure tests for drand48(), |
31 | random(), and rand() (in that order) and picks the first one it finds. |
32 | Perl programs that depend on reproducing a specific set of pseudo-random |
33 | numbers will now likely produce different output. |
34 | |
a5222a85 |
35 | =item Hashing function for hash keys has changed |
36 | |
37 | Perl hashes are not order preserving. The apparently random order |
38 | encountered when iterating on the contents of a hash is determined |
39 | by the hashing algorithm used. To improve the distribution of lower |
40 | bits in the hashed value, the algorithm has changed slightly as of |
41 | 5.005_52. When iterating over hashes, this may yield a random order |
42 | that is B<different> from that of previous versions. |
43 | |
44 | =item C<undef> fails on read only values |
45 | |
46 | Using the C<undef> operator on a readonly value (such as $1) has |
47 | the same effect as assigning C<undef> to the readonly value--it |
48 | throws an exception. |
49 | |
50 | =item Close-on-exec bit may be set on pipe() handles |
51 | |
52 | On systems that support a close-on-exec flag on filehandles, the |
53 | flag will be set for any handles created by pipe(), if that is |
54 | warranted by the value of $^F that may be in effect. Earlier |
55 | versions neglected to set the flag for handles created with |
56 | pipe(). See L<perlfunc/pipe> and L<perlvar/$^F>. |
57 | |
58 | =item Writing C<"$$1"> to mean C<"${$}1"> is unsupported |
59 | |
60 | Perl 5.004 deprecated the interpretation of C<$$1> and |
61 | similar within interpolated strings to mean C<$$ . "1">, |
62 | but still allowed it. |
63 | |
64 | In Perl 5.6 and later, C<"$$1"> always means C<"${$1}">. |
65 | |
66 | =item values(%h) and C<\(%h)> operate on aliases to values, not copies |
67 | |
68 | each(), values() and hashes in a list context return the actual |
69 | values in the hash, instead of copies (as they used to in earlier |
70 | versions). Typical idioms for using these constructs copy the |
71 | returned values, but this is can make a significant difference when |
72 | creating references to the returned values. |
73 | |
74 | Keys in the hash are still returned as copies when iterating on |
75 | on a hash. |
76 | |
77 | =item vec(EXPR,OFFSET,BITS) enforces powers-of-two BITS |
78 | |
79 | vec() generates a run-time error if the BITS arguments is not |
80 | a valid power-of-two integer. |
81 | |
82 | =item Text of some diagnostic output has changed |
83 | |
84 | Most references to internal Perl operations in diagnostics |
85 | have been changed to be more descriptive. This may be an |
86 | issue for programs that may incorrectly rely on the exact |
87 | text of diagnostics for proper functioning. |
88 | |
89 | =item C<%@> has been removed |
90 | |
91 | The undocumented special variable C<%@> that used to accumulate |
92 | "background" errors (such as those that happen in DESTROY()) |
93 | has been removed, because it could potentially result in memory |
94 | leaks. |
95 | |
757edf6f |
96 | =back |
97 | |
e02fdbd2 |
98 | =head2 C Source Incompatibilities |
99 | |
100 | =over 4 |
101 | |
102 | =item C<PERL_POLLUTE> |
103 | |
104 | Release 5.005 grandfathered old global symbol names by providing preprocessor |
87275199 |
105 | macros for extension source compatibility. As of release 5.6, these |
e02fdbd2 |
106 | preprocessor definitions are not available by default. You need to explicitly |
14218588 |
107 | compile perl with C<-DPERL_POLLUTE> to get these definitions. For |
108 | extensions still using the old symbols, this option can be |
2aea4d40 |
109 | specified via MakeMaker: |
110 | |
14218588 |
111 | perl Makefile.PL POLLUTE=1 |
e02fdbd2 |
112 | |
f29c64d6 |
113 | =item C<PERL_IMPLICIT_CONTEXT> |
114 | |
115 | This new build option provides a set of macros for all API functions |
116 | such that an implicit interpreter/thread context argument is passed to |
117 | every API function. As a result of this, something like C<sv_setsv(foo,bar)> |
2c2d71f5 |
118 | amounts to a macro invocation that actually translates to something like |
f29c64d6 |
119 | C<Perl_sv_setsv(my_perl,foo,bar)>. While this is generally expected |
120 | to not have any significant source compatibility issues, the difference |
121 | between a macro and a real function call will need to be considered. |
122 | |
2c2d71f5 |
123 | This means that there B<is> a source compatibility issue as a result of |
124 | this if your extensions attempt to use pointers to any of the Perl API |
125 | functions. |
126 | |
f29c64d6 |
127 | Note that the above issue is not relevant to the default build of |
128 | Perl, whose interfaces continue to match those of prior versions |
129 | (but subject to the other options described here). |
130 | |
651a3225 |
131 | PERL_IMPLICIT_CONTEXT is automatically enabled whenever Perl is built |
132 | with one of -Dusethreads, -Dusemultiplicity, or both. |
f29c64d6 |
133 | |
2c2d71f5 |
134 | See L<perlguts/"The Perl API"> for detailed information on the |
135 | ramifications of building Perl using this option. |
136 | |
86058a2d |
137 | =item C<PERL_POLLUTE_MALLOC> |
138 | |
14218588 |
139 | Enabling Perl's malloc in release 5.005 and earlier caused |
86058a2d |
140 | the namespace of system versions of the malloc family of functions to |
14218588 |
141 | be usurped by the Perl versions, since by default they used the |
142 | same names. |
86058a2d |
143 | |
144 | Besides causing problems on platforms that do not allow these functions to |
145 | be cleanly replaced, this also meant that the system versions could not |
146 | be called in programs that used Perl's malloc. Previous versions of Perl |
14218588 |
147 | have allowed this behaviour to be suppressed with the HIDEMYMALLOC and |
86058a2d |
148 | EMBEDMYMALLOC preprocessor definitions. |
149 | |
87275199 |
150 | As of release 5.6, Perl's malloc family of functions have default names |
86058a2d |
151 | distinct from the system versions. You need to explicitly compile perl with |
14218588 |
152 | C<-DPERL_POLLUTE_MALLOC> to get the older behaviour. HIDEMYMALLOC |
153 | and EMBEDMYMALLOC have no effect, since the behaviour they enabled is now |
86058a2d |
154 | the default. |
155 | |
156 | Note that these functions do B<not> constitute Perl's memory allocation API. |
157 | See L<perlguts/"Memory Allocation"> for further information about that. |
158 | |
e02fdbd2 |
159 | =item C<PL_na> and C<dTHR> Issues |
160 | |
161 | The C<PL_na> global is now thread local, so a C<dTHR> declaration is needed |
14218588 |
162 | in the scope in which the global appears. XSUBs should handle this automatically, |
e02fdbd2 |
163 | but if you have used C<PL_na> in support functions, you either need to |
164 | change the C<PL_na> to a local variable (which is recommended), or put in |
165 | a C<dTHR>. |
166 | |
167 | =back |
168 | |
cceca5ed |
169 | =head2 Compatible C Source API Changes |
170 | |
171 | =over |
172 | |
173 | =item C<PATCHLEVEL> is now C<PERL_VERSION> |
174 | |
14218588 |
175 | The cpp macros C<PERL_REVISION>, C<PERL_VERSION>, and C<PERL_SUBVERSION> |
cceca5ed |
176 | are now available by default from perl.h, and reflect the base revision, |
14218588 |
177 | patchlevel, and subversion respectively. C<PERL_REVISION> had no |
cceca5ed |
178 | prior equivalent, while C<PERL_VERSION> and C<PERL_SUBVERSION> were |
179 | previously available as C<PATCHLEVEL> and C<SUBVERSION>. |
180 | |
14218588 |
181 | The new names cause less pollution of the B<cpp> namespace and reflect what |
cceca5ed |
182 | the numbers have come to stand for in common practice. For compatibility, |
14218588 |
183 | the old names are still supported when F<patchlevel.h> is explicitly |
cceca5ed |
184 | included (as required before), so there is no source incompatibility |
14218588 |
185 | from the change. |
cceca5ed |
186 | |
a5222a85 |
187 | =item Support for C++ exceptions |
188 | |
189 | change#3386, also needs perlguts documentation |
190 | [TODO - Chip Salzenberg <chip@perlsupport.com>] |
191 | |
cceca5ed |
192 | =back |
193 | |
e02fdbd2 |
194 | =head2 Binary Incompatibilities |
195 | |
9c107f78 |
196 | The default build of this release is binary compatible with the 5.005 |
197 | release or its maintenance versions. |
f29c64d6 |
198 | |
199 | The usethreads or usemultiplicity builds are B<not> binary compatible |
200 | with the corresponding builds in 5.005. |
e02fdbd2 |
201 | |
a5222a85 |
202 | =head1 Installation and Configuration Improvements |
203 | |
204 | =head2 New Configure flags |
205 | |
206 | The following new flags may be enabled on the Configure command line |
207 | by running Configure with C<-Dflag>. |
208 | |
209 | usemultiplicity |
210 | usemorebits |
211 | uselargefiles |
212 | [what others?] |
213 | |
214 | [TODO - Jarkko Hietaniemi <jhi@iki.fi>] |
215 | |
216 | =head2 installusrbinperl |
217 | |
218 | You can use "Configure -Uinstallusrbinperl" which causes installperl |
219 | to skip installing perl also as /usr/bin/perl. This is useful if you |
220 | prefer not to modify /usr/bin for some reason or another but harmful |
221 | because many scripts assume to find Perl in /usr/bin/perl. |
222 | |
223 | =head2 SOCKS support |
224 | |
225 | You can use "Configure -Dusesocks" which causes Perl to probe |
226 | for the SOCKS proxy protocol library, http://www.socks.nec.com/ |
227 | |
228 | =head2 C<-A> flag |
229 | |
230 | You can "post-edit" the Configure variables using the Configure C<-A> |
231 | flag. The editing happens immediately after the platform specific |
232 | hints files have been processed but before the actual configuration |
233 | process starts. Run C<Configure -h> to find out the full C<-A> syntax. |
234 | |
ba8251e8 |
235 | =head1 Core Changes |
236 | |
9d73390d |
237 | =head2 Unicode and UTF-8 support |
238 | |
239 | Perl can optionally use UTF-8 as its internal representation for character |
a5222a85 |
240 | strings. The C<utf8> pragma enables this support in the current lexical |
9d73390d |
241 | scope. See L<utf8> for more information. |
242 | |
243 | =head2 Lexically scoped warning categories |
244 | |
245 | You can now control the granularity of warnings emitted by perl at a finer |
4438c4b7 |
246 | level using the C<use warnings> pragma. See L<warnings> and L<perllexwarn> |
0453d815 |
247 | for details. |
9d73390d |
248 | |
a5222a85 |
249 | =head2 Lvalue subroutines |
250 | |
251 | WARNING: This is an experimental feature. |
252 | |
253 | change#4081 |
254 | [TODO - Ilya Zakharevich <ilya@math.ohio-state.edu>, |
255 | Tuomas Lukka <lukka@fas.harvard.edu>)] |
256 | |
257 | =head2 "our" declarations |
258 | |
259 | An "our" declaration introduces a value that can be best understood |
260 | as a lexically scoped symbolic alias to a global variable in the |
261 | current package. This is mostly useful as an alternative to the |
262 | C<vars> pragma, but also provides the opportunity to introduce |
263 | typing and other attributes for such variables. See L<perlfunc/our>. |
264 | |
265 | =head2 Weak references |
266 | |
267 | WARNING: This is an experimental feature. |
268 | |
269 | change#3385, also need perlguts documentation |
270 | |
271 | [TODO - Tuomas Lukka <lukka@fas.harvard.edu>] |
272 | |
5fdc711f |
273 | =head2 Binary numbers supported |
274 | |
4f19785b |
275 | Binary numbers are now supported as literals, in s?printf formats, and |
276 | C<oct()>: |
277 | |
14218588 |
278 | $answer = 0b101010; |
279 | printf "The answer is: %b\n", oct("0b101010"); |
4f19785b |
280 | |
a5222a85 |
281 | =head2 Some arrows may be omitted in calls through references |
282 | |
283 | Perl now allows the arrow to be omitted in many constructs |
284 | involving subroutine calls through references. For example, |
285 | C<$foo[10]->('foo')> may now be written C<$foo[10]('foo')>. |
286 | This is rather similar to how the arrow may be omitted from |
287 | C<$foo[10]->{'foo'}>. Note however, that the arrow is still |
288 | required for C<foo(10)->('bar')>. |
289 | |
5fdc711f |
290 | =head2 syswrite() ease-of-use |
291 | |
a5222a85 |
292 | The length argument of C<syswrite()> has become optional. |
293 | |
294 | =head2 Filehandles can be autovivified |
295 | |
296 | The construct C<open(my $fh, ...)> can be used to create filehandles |
297 | more easily. The filehandle will be automatically closed at the end |
298 | of the scope of $fh, provided there are no other references to it. This |
299 | largely eliminates the need for typeglobs when opening filehandles |
300 | that must be passed around, as in the following example: |
301 | |
302 | sub myopen { |
303 | open my $fh, "@_" |
304 | or die "Can't open '@_': $!"; |
305 | return $fh; |
306 | } |
307 | |
308 | { |
309 | my $f = myopen("</etc/motd"); |
310 | print <$f>; |
311 | # $f implicitly closed here |
312 | } |
313 | |
314 | [TODO - this idiom needs more pod penetration] |
6c67e1bb |
315 | |
5fdc711f |
316 | =head2 64-bit support |
317 | |
9c107f78 |
318 | All platforms that have 64-bit integers either (a) natively as longs |
319 | or ints (b) via special compiler flags (c) using long long are able to |
320 | use "quads" (64-integers) as follows: |
321 | |
322 | =over 4 |
323 | |
a5222a85 |
324 | =item * |
325 | |
326 | constants (decimal, hexadecimal, octal, binary) in the code |
327 | |
328 | =item * |
9c107f78 |
329 | |
a5222a85 |
330 | arguments to oct() and hex() |
9c107f78 |
331 | |
a5222a85 |
332 | =item * |
333 | |
334 | arguments to print(), printf() and sprintf() (flag prefixes ll, L, q) |
335 | |
336 | =item * |
9c107f78 |
337 | |
a5222a85 |
338 | printed as such |
9c107f78 |
339 | |
a5222a85 |
340 | =item * |
341 | |
342 | pack() and unpack() "q" and "Q" formats |
343 | |
344 | =item * |
345 | |
346 | in basic arithmetics: + - * / % |
347 | |
348 | =item * |
1fad5d67 |
349 | |
a5222a85 |
350 | vec() (but see the below note about bit arithmetics) |
9c107f78 |
351 | |
352 | =back |
353 | |
354 | Note that unless you have the case (a) you will have to configure |
355 | and compile Perl using the -Duse64bits Configure flag. |
356 | |
3175b8cd |
357 | Unfortunately bit arithmetics (&, |, ^, ~, <<, >>) for numbers are not |
358 | 64-bit clean, they are explictly forced to be 32-bit. Bit arithmetics |
359 | for bit vectors (created by vec()) are not limited in their width. |
d0ba1bd2 |
360 | |
2d4389e4 |
361 | Last but not least: note that due to Perl's habit of always using |
d0ba1bd2 |
362 | floating point numbers the quads are still not true integers. |
363 | When quads overflow their limits (0...18_446_744_073_709_551_615 unsigned, |
364 | -9_223_372_036_854_775_808...9_223_372_036_854_775_807 signed), they |
365 | are silently promoted to floating point numbers, after which they will |
366 | start losing precision (their lower digits). |
2d4389e4 |
367 | |
368 | =head2 Large file support |
369 | |
370 | If you have filesystems that support "large files" (files larger than |
aa855319 |
371 | 2 gigabytes), you may now also be able to create and access them from |
249b38c6 |
372 | Perl. You have to use Configure -Duselargefiles. Turning on the |
373 | large file support turns on also the 64-bit support, for obvious reasons. |
2d4389e4 |
374 | |
eed7fde4 |
375 | Note that in addition to requiring a proper file system to do large |
376 | files you may also need to adjust your per-process (or your |
377 | per-system, or per-process-group, or per-user-group) maximum filesize |
378 | limits before running Perl scripts that try to handle large files, |
379 | especially if you intend to write such files. |
380 | |
381 | Finally, in addition to your process/process group maximum filesize |
382 | limits, you may have quota limits on your filesystems that stop you |
383 | (your user id or your user group id) from using large files. |
384 | |
385 | Adjusting your process/user/group/file system/operating system limits |
386 | is outside the scope of Perl core language. For process limits, you |
387 | may try increasing the limits using your shell's limits/limit/ulimit |
388 | command before running Perl. The BSD::Resource extension (not |
389 | included with the standard Perl distribution) may also be of use, it |
390 | offers the getrlimit/setrlimit interface that can be used to adjust |
391 | process resource usage limits, including the maximum filesize limit. |
2d4389e4 |
392 | |
aa855319 |
393 | =head2 Long doubles |
394 | |
395 | In some systems you may be able to use long doubles to enhance the |
396 | range of precision of your double precision floating point numbers |
397 | (that is, Perl's numbers). Use Configure -Duselongdouble to enable |
398 | this support (if it is available). |
399 | |
400 | =head2 "more bits" |
401 | |
402 | You can Configure -Dusemorebits to turn on both the 64-bit support |
403 | and the long double support. |
09bef843 |
404 | |
62c18ce2 |
405 | =head2 Better syntax checks on parenthesized unary operators |
406 | |
407 | Expressions such as: |
408 | |
14218588 |
409 | print defined(&foo,&bar,&baz); |
410 | print uc("foo","bar","baz"); |
411 | undef($foo,&bar); |
62c18ce2 |
412 | |
7711098a |
413 | used to be accidentally allowed in earlier versions, and produced |
14218588 |
414 | unpredictable behaviour. Some produced ancillary warnings |
415 | when used in this way; others silently did the wrong thing. |
62c18ce2 |
416 | |
417 | The parenthesized forms of most unary operators that expect a single |
14218588 |
418 | argument now ensure that they are not called with more than one |
419 | argument, making the cases shown above syntax errors. The usual |
420 | behaviour of: |
62c18ce2 |
421 | |
14218588 |
422 | print defined &foo, &bar, &baz; |
423 | print uc "foo", "bar", "baz"; |
424 | undef $foo, &bar; |
62c18ce2 |
425 | |
426 | remains unchanged. See L<perlop>. |
427 | |
3e3318e7 |
428 | =head2 POSIX character class syntax [: :] supported |
429 | |
430 | For example to match alphabetic characters use /[[:alpha:]]/. |
431 | See L<perlre> for details. |
432 | |
5a929a98 |
433 | =head2 Improved C<qw//> operator |
8127e0e3 |
434 | |
26ef7447 |
435 | The C<qw//> operator is now evaluated at compile time into a true list |
436 | instead of being replaced with a run time call to C<split()>. This |
14218588 |
437 | removes the confusing misbehaviour of C<qw//> in scalar context, which |
438 | had inherited that behaviour from split(). |
26ef7447 |
439 | |
440 | Thus: |
441 | |
442 | $foo = ($bar) = qw(a b c); print "$foo|$bar\n"; |
443 | |
444 | now correctly prints "3|a", instead of "2|a". |
8127e0e3 |
445 | |
5a929a98 |
446 | =head2 pack() format 'Z' supported |
447 | |
448 | The new format type 'Z' is useful for packing and unpacking null-terminated |
449 | strings. See L<perlfunc/"pack">. |
450 | |
4d0c1c44 |
451 | =head2 pack() format modifier '!' supported |
ee3907e2 |
452 | |
14218588 |
453 | The new format type modifier '!' is useful for packing and unpacking |
ee3907e2 |
454 | native shorts, ints, and longs. See L<perlfunc/"pack">. |
455 | |
f29c64d6 |
456 | =head2 pack() and unpack() support counted strings |
457 | |
a5222a85 |
458 | The template character '/' can be used to specify a counted string |
f29c64d6 |
459 | type to be packed or unpacked. See L<perlfunc/"pack">. |
460 | |
a5222a85 |
461 | =head2 Comments in pack() templates |
462 | |
463 | The '#' character in a template introduces a comment up to |
464 | end of the line. This facilitates documentation of pack() |
465 | templates. |
466 | |
2b92dfce |
467 | =head2 $^X variables may now have names longer than one character |
468 | |
469 | Formerly, $^X was synonymous with ${"\cX"}, but $^XY was a syntax |
470 | error. Now variable names that begin with a control character may be |
471 | arbitrarily long. However, for compatibility reasons, these variables |
472 | I<must> be written with explicit braces, as C<${^XY}> for example. |
14218588 |
473 | C<${^XYZ}> is synonymous with ${"\cXYZ"}. Variable names with more |
2b92dfce |
474 | than one control character, such as C<${^XY^Z}>, are illegal. |
475 | |
14218588 |
476 | The old syntax has not changed. As before, `^X' may be either a |
477 | literal control-X character or the two-character sequence `caret' plus |
478 | `X'. When braces are omitted, the variable name stops after the |
2b92dfce |
479 | control character. Thus C<"$^XYZ"> continues to be synonymous with |
7711098a |
480 | C<$^X . "YZ"> as before. |
2b92dfce |
481 | |
482 | As before, lexical variables may not have names beginning with control |
483 | characters. As before, variables whose names begin with a control |
14218588 |
484 | character are always forced to be in package `main'. All such variables |
485 | are reserved for future extensions, except those that begin with |
09bef843 |
486 | C<^_>, which may be used by user programs and are guaranteed not to |
14218588 |
487 | acquire special meaning in any future version of Perl. |
2b92dfce |
488 | |
09bef843 |
489 | =head2 C<use attrs> implicit in subroutine attributes |
490 | |
491 | Formerly, if you wanted to mark a subroutine as being a method call or |
492 | as requiring an automatic lock() when it is entered, you had to declare |
493 | that with a C<use attrs> pragma in the body of the subroutine. |
494 | That can now be accomplished with a declaration syntax, like this: |
495 | |
496 | sub mymethod : locked, method ; |
497 | ... |
498 | sub mymethod : locked, method { |
499 | ... |
500 | } |
501 | |
502 | F<AutoSplit.pm> and F<SelfLoader.pm> have been updated to keep the attributes |
503 | with the stubs they provide. See L<attributes>. |
504 | |
a5222a85 |
505 | =head2 Regular expression improvements |
506 | |
507 | change#2827,2373,2372,2365,1813,1800,4112,4158,4215,4301 |
508 | [TODO - Ilya Zakharevich <ilya@math.ohio-state.edu>] |
509 | |
510 | =head2 Overloading improvements |
511 | |
512 | change#2150 |
513 | [TODO - Ilya Zakharevich <ilya@math.ohio-state.edu>] |
514 | |
515 | =head2 open() with more than two arguments |
516 | |
517 | [TODO - Ilya Zakharevich <ilya@math.ohio-state.edu>] |
518 | |
519 | =head2 Support for interpolating named characters |
520 | |
521 | change#4052 |
522 | [TODO - Ilya Zakharevich <ilya@math.ohio-state.edu>] |
523 | |
524 | =head2 Experimental support form user-hooks in @INC |
525 | |
526 | [TODO - Ken Fox <kfox@ford.com>] |
527 | |
528 | =head2 C<require> and C<do> may be overridden |
529 | |
530 | C<require> and C<do 'file'> operations may be overridden locally |
531 | by importing subroutines of the same name into the current package |
532 | (or globally by importing them into the CORE::GLOBAL:: namespace). |
533 | Overriding C<require> will also affect C<use>, provided the override |
534 | is visible at compile-time. |
535 | See L<perlsub/"Overriding Built-in Functions">. |
536 | |
537 | =head2 New variable $^C reflects C<-c> switch |
538 | |
539 | C<$^C> contains a boolean that reflects whether perl is being run |
540 | in compile-only mode (i.e. via the C<-c> switch). Since |
541 | BEGIN blocks are executed under such conditions, this variable |
542 | enables perl code to determine whether actions that make sense |
543 | only during normal running are warranted. See L<perlvar>. |
544 | |
545 | =head2 Optional Y2K warnings |
546 | |
547 | If Perl is built with the cpp macro C<PERL_Y2KWARN> defined, |
548 | it emits optional warnings when concatenating the number 19 |
549 | with another number. |
550 | |
551 | This behavior must be specifically enabled when running Configure. |
552 | See L<INSTALL> and L<README.Y2K>. |
553 | |
fbad3eb5 |
554 | =head1 Significant bug fixes |
555 | |
556 | =head2 E<lt>HANDLEE<gt> on empty files |
557 | |
558 | With C<$/> set to C<undef>, slurping an empty file returns a string of |
14218588 |
559 | zero length (instead of C<undef>, as it used to) the first time the |
560 | HANDLE is read. Further reads yield C<undef>. |
fbad3eb5 |
561 | |
562 | This means that the following will append "foo" to an empty file (it used |
14218588 |
563 | to do nothing): |
fbad3eb5 |
564 | |
565 | perl -0777 -pi -e 's/^/foo/' empty_file |
566 | |
14218588 |
567 | The behaviour of: |
fbad3eb5 |
568 | |
569 | perl -pi -e 's/^/foo/' empty_file |
570 | |
571 | is unchanged (it continues to leave the file empty). |
572 | |
0244c3a4 |
573 | =head2 C<eval '...'> improvements |
574 | |
575 | Line numbers (as reflected by caller() and most diagnostics) within |
576 | C<eval '...'> were often incorrect when here documents were involved. |
577 | This has been corrected. |
578 | |
579 | Lexical lookups for variables appearing in C<eval '...'> within |
580 | functions that were themselves called within an C<eval '...'> were |
14218588 |
581 | searching the wrong place for lexicals. The lexical search now |
582 | correctly ends at the subroutine's block boundary. |
0244c3a4 |
583 | |
584 | Parsing of here documents used to be flawed when they appeared as |
585 | the replacement expression in C<eval 's/.../.../e'>. This has |
586 | been fixed. |
587 | |
a5222a85 |
588 | =head2 All compilation errors are true errors |
589 | |
590 | Some "errors" encountered at compile time were by neccessity |
591 | generated as warnings followed by eventual termination of the |
592 | program. This enabled more such errors to be reported in a |
593 | single run, rather than causing a hard stop at the first error |
594 | that was encountered. |
595 | |
596 | The mechanism for reporting such errors has been reimplemented |
597 | to queue compile-time errors and report them at the end of the |
598 | compilation as true errors rather than as warnings. This fixes |
599 | error messages that used to leak through as warnings when code |
600 | was compiled at run time using C<eval STRING>, and allows such |
601 | errors to be reliably trapped using __DIE__ hooks. |
602 | |
45bc9206 |
603 | =head2 Automatic flushing of output buffers |
604 | |
14218588 |
605 | fork(), exec(), system(), qx//, and pipe open()s now flush buffers |
606 | of all files opened for output when the operation |
607 | was attempted. This mostly eliminates confusing |
45bc9206 |
608 | buffering mishaps suffered by users unaware of how Perl internally |
14218588 |
609 | handles I/O. |
45bc9206 |
610 | |
af8c498a |
611 | =head2 Better diagnostics on meaningless filehandle operations |
612 | |
613 | Constructs such as C<open(E<lt>FHE<gt>)> and C<close(E<lt>FHE<gt>)> |
614 | are compile time errors. Attempting to read from filehandles that |
615 | were opened only for writing will now produce warnings (just as |
616 | writing to read-only filehandles does). |
617 | |
a5222a85 |
618 | =head2 Where possible, buffered data discarded from duped input filehandle |
619 | |
620 | C<open(NEW, "E<lt>&OLD")> now attempts to discard any data that |
621 | was previously read and buffered in C<OLD> before duping the handle. |
622 | On platforms where doing this is allowed, the next read operation |
623 | on C<NEW> will return the same data as the corresponding operation |
624 | on C<OLD>. Formerly, it would have returned the data from the start |
625 | of the following disk block instead. |
626 | |
627 | =head2 system(), backticks and pipe open now reflect exec() failure |
628 | |
629 | On Unix and similar platforms, system(), qx() and open(FOO, "cmd |") |
630 | etc., are implemented via fork() and exec(). When the underlying |
631 | exec() fails, earlier versions did not report the error properly, |
632 | since the exec() happened to be in a different process. |
633 | |
634 | The child process now communicates with the parent about the |
635 | error in launching the external command, which allow these |
636 | constructs to return with their usual error value and set $!. |
637 | |
638 | =head2 Implicitly closed filehandles are safer |
639 | |
640 | Sometimes implicitly closed filehandles (as when they are localized, |
641 | and Perl automatically closes them on exiting the scope) could |
642 | inadvertently set $? or $!. This has been corrected. |
643 | |
644 | =head2 C<(\$)> prototype and C<$foo{a}> |
645 | |
646 | An scalar reference prototype now correctly allows a hash or |
647 | array element in that slot. |
648 | |
649 | =head2 Pseudo-hashes work better |
650 | |
651 | Dereferencing some types of reference values in a pseudo-hash, |
652 | such as C<$ph->{foo}[1]>, was accidentally disallowed. This has |
653 | been corrected. |
654 | |
655 | When applied to a pseudo-hash element, exists() now reports whether |
656 | the specified value exists, not merely if the key is valid. |
657 | |
658 | =head2 C<goto &sub> and AUTOLOAD |
659 | |
660 | C<goto &sub> construct works correctly when C<&sub> happens |
661 | to be autoloaded. |
662 | |
663 | =head2 C<-bareword> allowed under C<use integer> |
664 | |
665 | The autoquoting of barewords preceded by C<-> did not work |
666 | in prior versions when the C<integer> pragma was enabled. |
667 | This has been fixed. |
668 | |
669 | =head2 Boolean assignment operators are legal lvalues |
670 | |
671 | Constructs such as C<($a ||= 2) += 1> are now allowed. |
672 | |
673 | =head2 C<sort $coderef @foo> allowed |
674 | |
675 | sort() did not accept a subroutine reference as the comparison |
676 | function in earlier versions. This has been fixed. |
677 | |
678 | =head2 Failures in DESTROY() |
679 | |
680 | When code in a destructor threw an exception, it went unnoticed |
681 | in earlier versions of Perl, unless someone happened to be |
682 | looking in $@ just after the point the destructor happened to |
683 | run. Such failures are now visible as warnings when warnings are |
684 | enabled. |
685 | |
686 | =head2 Locale bugs fixed |
54195c32 |
687 | |
a5222a85 |
688 | change#3542 |
689 | [TODO - Jarkko Hietaniemi <jhi@iki.fi>] |
54195c32 |
690 | |
a5222a85 |
691 | =head2 Memory leaks |
692 | |
693 | The C<eval 'return sub {...}'> construct could sometimes leak |
694 | memory. This has been fixed. |
695 | |
696 | Operations that aren't filehandle constructors used to leak memory |
697 | when used on invalid filehandles. This has been fixed. |
698 | |
699 | Constructs that modified C<@_> could fail to deallocate values |
700 | in C<@_> and thus leak memory. This has been corrected. |
701 | |
702 | =head2 Spurious subroutine stubs after failed subroutine calls |
703 | |
704 | Perl could sometimes create empty subroutine stubs when a |
705 | subroutine was not found in the package. Such cases stopped |
706 | later method lookups from progressing into base packages. |
707 | This has been corrected. |
708 | |
709 | =head2 Consistent numeric conversions |
710 | |
711 | change#3378,3318 |
712 | [TODO - Ilya Zakharevich <ilya@math.ohio-state.edu>] |
713 | |
714 | =head2 Taint failures under C<-U> |
715 | |
716 | When running in unsafe mode, taint violations could sometimes |
717 | cause silent failures. This has been fixed. |
718 | |
719 | =head2 END blocks and the C<-c> switch |
720 | |
721 | Prior versions used to run BEGIN B<and> END blocks when Perl was |
722 | run in compile-only mode. Since this is typically not the expected |
723 | behavior, END blocks are not executed when the C<-c> switch |
724 | is used. |
725 | |
726 | Note that something resembling the previous behavior can still be |
727 | obtained by putting C<BEGIN { $^C = 0; exit; } at the very end of |
728 | the top level source file. |
729 | |
730 | =head2 Potential to leak DATA filehandles |
731 | |
732 | Using the C<__DATA__> token creates an implicit filehandle to |
733 | the file that contains the token. It is the program's |
734 | responsibility to close it when it is done reading from it. |
735 | |
736 | This caveat is now better explained in the documentation. |
737 | See L<perldata>. |
738 | |
739 | =head2 Diagnostics follow STDERR |
740 | |
741 | Diagnostic output now goes to whichever file the C<STDERR> handle |
742 | is pointing at, instead of always going to the underlying C runtime |
743 | library's C<stderr>. |
744 | |
745 | =head2 Other fixes for better diagnostics |
746 | |
747 | Line numbers are suppressed no more (under most likely circumstances) |
748 | during the global destruction phase. |
749 | |
750 | Diagnostics emitted from code running in threads other than the main |
751 | thread are now accompanied by the thread ID. |
752 | |
753 | Embedded null characters in diagnostics now actually show up. They |
754 | used to truncate the message in prior versions. |
755 | |
756 | $foo::a and $foo::b are now exempt from "possible typo" warnings only |
757 | if sort() is encountered in package foo. |
758 | |
759 | Unrecognized alphabetic escapes encountered when parsing quoting |
760 | constructs now generate a warning, since they may take on new |
761 | semantics in later versions of Perl. |
762 | |
763 | =head1 Performance enhancements |
764 | |
765 | =head2 Simple sort() using { $a <=> $b } and the like are optimized |
766 | |
767 | Many common sort() opertions using a simple inlined block are now |
768 | optimized for faster performance. |
769 | |
770 | =head2 Optimized assignments to lexical variables |
771 | |
772 | Certain operations in the RHS of assignment statements have been |
773 | optimized to directly set the lexical variable on the LHS, |
774 | eliminating redundant copying overheads. |
775 | |
776 | =head2 Method lookups optimized |
777 | |
778 | [TODO - Chip Salzenberg <chip@perlsupport.com>] |
779 | |
780 | =head2 Faster mechanism to invoke XSUBs |
781 | |
782 | change#4044,4125 |
783 | [TODO - Ilya Zakharevich <ilya@math.ohio-state.edu>] |
784 | |
785 | =head2 Perl_malloc() improvements |
786 | |
787 | change#4237 |
788 | [TODO - Ilya Zakharevich <ilya@math.ohio-state.edu>] |
789 | |
790 | =head2 Faster subroutine calls |
791 | |
792 | Minor changes in how subroutine calls are handled internally |
793 | provide marginal improvements in performance. |
794 | |
795 | =head1 Platform specific changes |
796 | |
797 | =head2 Additional supported platforms |
ba8251e8 |
798 | |
5fdc711f |
799 | =over 4 |
800 | |
801 | =item * |
802 | |
6c67e1bb |
803 | VM/ESA is now supported. |
804 | |
5fdc711f |
805 | =item * |
806 | |
ee3907e2 |
807 | Siemens BS2000 is now supported under the POSIX Shell. |
808 | |
809 | =item * |
810 | |
2bb14304 |
811 | The Mach CThreads (NEXTSTEP, OPENSTEP) are now supported by the Thread |
812 | extension. |
6c67e1bb |
813 | |
5fdc711f |
814 | =item * |
815 | |
ee3907e2 |
816 | GNU/Hurd is now supported. |
6c67e1bb |
817 | |
00ad96e1 |
818 | =item * |
819 | |
820 | Rhapsody is now supported. |
821 | |
27806c82 |
822 | =item * |
823 | |
824 | EPOC is is now supported (on Psion 5). |
825 | |
5fdc711f |
826 | =back |
827 | |
a5222a85 |
828 | =head2 DOS |
829 | |
830 | [TODO - Laszlo Molnar <laszlo.molnar@eth.ericsson.se>] |
831 | |
832 | =head2 OS/2 |
833 | |
834 | [TODO - Ilya Zakharevich <ilya@math.ohio-state.edu>] |
835 | |
836 | =head2 VMS |
837 | |
838 | [TODO - Charles Bailey <bailey@newman.upenn.edu>] |
839 | |
840 | =head2 Win32 |
841 | |
842 | Site library searches failed to look for ".../site/5.XXX/lib" |
843 | if ".../site/5.XXXYY/lib" wasn't found. This has been corrected. |
844 | |
845 | When given a pathname that consists only of a drivename, such |
846 | as C<A:>, opendir() and stat() now use the current working |
847 | directory for the drive rather than the drive root. |
848 | |
849 | The builtin XSUB functions in the Win32:: namespace are |
850 | documented. See L<Win32>. |
851 | |
852 | $^X now contains the full path name of the running executable. |
853 | |
854 | A Win32::GetLongPathName() function is provided to complement |
855 | Win32::GetFullPathName() and Win32::GetShortPathName(). See L<Win32>. |
856 | |
857 | POSIX::uname() is supported. |
858 | |
859 | system(1,...) now returns true process IDs rather than process |
860 | handles. kill() accepts any real process id, rather than strictly |
861 | return values from system(1,...). |
862 | |
863 | The C<Shell> module is supported. |
864 | |
865 | [TODO - GSAR] |
866 | |
6c67e1bb |
867 | =head1 New tests |
868 | |
869 | =over 4 |
870 | |
09bef843 |
871 | =item lib/attrs |
872 | |
873 | Compatibility tests for C<sub : attrs> vs the older C<use attrs>. |
874 | |
875 | =item lib/io_const |
6c67e1bb |
876 | |
877 | IO constants (SEEK_*, _IO*). |
14218588 |
878 | |
09bef843 |
879 | =item lib/io_dir |
6c67e1bb |
880 | |
881 | Directory-related IO methods (new, read, close, rewind, tied delete). |
882 | |
09bef843 |
883 | =item lib/io_multihomed |
6c67e1bb |
884 | |
885 | INET sockets with multi-homed hosts. |
886 | |
09bef843 |
887 | =item lib/io_poll |
6c67e1bb |
888 | |
889 | IO poll(). |
890 | |
09bef843 |
891 | =item lib/io_unix |
6c67e1bb |
892 | |
893 | UNIX sockets. |
894 | |
09bef843 |
895 | =item op/attrs |
896 | |
897 | Regression tests for C<my ($x,@y,%z) : attrs> and <sub : attrs>. |
898 | |
6c67e1bb |
899 | =item op/filetest |
900 | |
901 | File test operators. |
902 | |
903 | =item op/lex_assign |
904 | |
5fdc711f |
905 | Verify operations that access pad objects (lexicals and temporaries). |
6c67e1bb |
906 | |
907 | =back |
e02fdbd2 |
908 | |
ba8251e8 |
909 | =head1 Modules and Pragmata |
910 | |
3e8c4fa0 |
911 | =head2 Modules |
912 | |
b7d8191e |
913 | =over 4 |
914 | |
09bef843 |
915 | =item attributes |
916 | |
917 | While used internally by Perl as a pragma, this module also |
918 | provides a way to fetch subroutine and variable attributes. |
919 | See L<attributes>. |
920 | |
a5222a85 |
921 | =item B |
922 | |
923 | [TODO - Vishal Bhatia <vishal@gol.com>, |
924 | Nick Ing-Simmons <nick@ni-s.u-net.com>] |
925 | |
f29c64d6 |
926 | =item ByteLoader |
927 | |
a5222a85 |
928 | The ByteLoader is a dedicated extension to generate and run |
f29c64d6 |
929 | Perl bytecode. See L<ByteLoader>. |
930 | |
931 | =item B |
932 | |
933 | The Perl Compiler suite has been extensively reworked for this |
934 | release. |
935 | |
a5222a85 |
936 | =item constant |
937 | |
938 | References can now be used. See L<constant>. |
939 | |
940 | =item charnames |
941 | |
942 | change#4052 |
943 | [TODO - Ilya Zakharevich <ilya@math.ohio-state.edu>] |
944 | |
945 | =item Data::Dumper |
946 | |
947 | A C<Maxdepth> setting can be specified to avoid venturing |
948 | too deeply into data structures that may be very deep. |
949 | See L<Data::Dumper>. |
950 | |
951 | Dumping C<qr//> objects works correctly. |
952 | |
953 | =item DB |
954 | |
955 | C<DB> is an experimental module that exposes a clean abstraction |
956 | to Perl's debugging API. |
957 | |
958 | =item DB_File |
959 | |
960 | [TODO - Paul Marquess <paul.marquess@bt.com>] |
961 | |
f29c64d6 |
962 | =item Devel::DProf |
963 | |
a5222a85 |
964 | Devel::DProf, a Perl source code profiler has been added. See L<DProf>. |
f29c64d6 |
965 | |
b7d8191e |
966 | =item Dumpvalue |
967 | |
968 | Added Dumpvalue module provides screen dumps of Perl data. |
969 | |
970 | =item Benchmark |
971 | |
868cb350 |
972 | You can now run tests for I<n> seconds instead of guessing the right |
14218588 |
973 | number of tests to run: e.g. timethese(-5, ...) will run each |
974 | code for at least 5 CPU seconds. Zero as the "number of repetitions" |
155776c0 |
975 | means "for at least 3 CPU seconds". The output format has also |
14218588 |
976 | changed. For example: |
155776c0 |
977 | |
978 | use Benchmark;$x=3;timethese(-5,{a=>sub{$x*$x},b=>sub{$x**2}}) |
979 | |
980 | will now output something like this: |
981 | |
982 | Benchmark: running a, b, each for at least 5 CPU seconds... |
983 | a: 5 wallclock secs ( 5.77 usr + 0.00 sys = 5.77 CPU) @ 200551.91/s (n=1156516) |
984 | b: 4 wallclock secs ( 5.00 usr + 0.02 sys = 5.02 CPU) @ 159605.18/s (n=800686) |
985 | |
986 | New features: "each for at least N CPU seconds...", "wallclock secs", |
987 | and the "@ operations/CPU second (n=operations)". |
b7d8191e |
988 | |
a5222a85 |
989 | change#4265,4266,4292 |
990 | [TODO - Barrie Slaymaker <barries@slaysys.com>] |
991 | |
f505c983 |
992 | =item Devel::Peek |
993 | |
994 | The Devel::Peek module provides access to the internal representation |
14218588 |
995 | of Perl variables and data. It is a data debugging tool for the XS programmer. |
f505c983 |
996 | |
a5222a85 |
997 | =item ExtUtils::MakeMaker |
998 | |
999 | change#4135, also needs docs in module pod |
1000 | [TODO - Ilya Zakharevich <ilya@math.ohio-state.edu>] |
1001 | |
b7d8191e |
1002 | =item Fcntl |
1003 | |
1004 | More Fcntl constants added: F_SETLK64, F_SETLKW64, O_LARGEFILE for |
14218588 |
1005 | large (more than 4G) file access (64-bit support is not yet |
b7d8191e |
1006 | working, though, so no need to get overly excited), Free/Net/OpenBSD |
1007 | locking behaviour flags F_FLOCK, F_POSIX, Linux F_SHLCK, and |
1008 | O_ACCMODE: the mask of O_RDONLY, O_WRONLY, and O_RDWR. |
1009 | |
a5222a85 |
1010 | =item File::Compare |
1011 | |
1012 | A compare_text() function has been added, which allows custom |
1013 | comparison functions. See L<File::Compare>. |
1014 | |
1015 | =item File::Find |
1016 | |
1017 | File::Find now works correctly when the wanted() function is either |
1018 | autoloaded or is a symbolic reference. |
1019 | |
1020 | A bug that cause File::Find to lose track of the working directory |
1021 | when pruning top-level directories has been fixed. |
1022 | |
f505c983 |
1023 | =item File::Spec |
1024 | |
1025 | New methods have been added to the File::Spec module: devnull() returns |
19799a22 |
1026 | the name of the null device (/dev/null on Unix) and tmpdir() the name of |
14218588 |
1027 | the temp directory (normally /tmp on Unix). There are now also methods |
f505c983 |
1028 | to convert between absolute and relative filenames: abs2rel() and |
14218588 |
1029 | rel2abs(). For compatibility with operating systems that specify volume |
1030 | names in file paths, the splitpath(), splitdir(), and catdir() methods |
f505c983 |
1031 | have been added. |
1032 | |
1033 | =item File::Spec::Functions |
1034 | |
1035 | The new File::Spec::Functions modules provides a function interface |
14218588 |
1036 | to the File::Spec module. Allows shorthand |
f505c983 |
1037 | |
14218588 |
1038 | $fullname = catfile($dir1, $dir2, $file); |
f505c983 |
1039 | |
1040 | instead of |
1041 | |
14218588 |
1042 | $fullname = File::Spec->catfile($dir1, $dir2, $file); |
f505c983 |
1043 | |
a5222a85 |
1044 | =item Getopt::Long |
1045 | |
1046 | [TODO - Johan Vromans <jvromans@squirrel.nl>] |
1047 | |
1048 | =item IO |
1049 | |
1050 | write() and syswrite() will now accept a single-argument |
1051 | form of the call, for consistency with Perl's syswrite(). |
1052 | |
1053 | You can now create a TCP-based IO::Socket::INET without forcing |
1054 | a connect attempt. This allows you to configure its options |
1055 | (like making it non-blocking) and then call connect() manually. |
1056 | |
1057 | A bug that prevented the IO::Socket::protocol() accessor |
1058 | from ever returning the correct value has been corrected. |
1059 | |
1060 | =item JPL |
1061 | |
1062 | Java Perl Lingo is now distributed with Perl. See jpl/README |
1063 | for more information. |
1064 | |
e16b8f49 |
1065 | =item Math::BigInt |
1066 | |
14218588 |
1067 | The logical operations C<E<lt>E<lt>>, C<E<gt>E<gt>>, C<&>, C<|>, |
e16b8f49 |
1068 | and C<~> are now supported on bigints. |
1069 | |
b7d8191e |
1070 | =item Math::Complex |
7711098a |
1071 | |
14218588 |
1072 | The accessor methods Re, Im, arg, abs, rho, and theta can now also |
868cb350 |
1073 | act as mutators (accessor $z->Re(), mutator $z->Re(3)). |
b7d8191e |
1074 | |
1075 | =item Math::Trig |
1076 | |
14218588 |
1077 | A little bit of radial trigonometry (cylindrical and spherical), |
1078 | radial coordinate conversions, and the great circle distance were added. |
b7d8191e |
1079 | |
a5222a85 |
1080 | =item Pod::Parser |
1081 | |
1082 | [TODO - Brad Appleton <bradapp@enteract.com>] |
1083 | |
1084 | =item Pod::Text and Pod::Man |
1085 | |
1086 | [TODO - Russ Allbery <rra@stanford.edu>] |
1087 | |
f4b9d880 |
1088 | =item SDBM_File |
1089 | |
1090 | An EXISTS method has been added to this module (and sdbm_exists() has |
1091 | been added to the underlying sdbm library), so one can now call exists |
14218588 |
1092 | on an SDBM_File tied hash and get the correct result, rather than a |
f4b9d880 |
1093 | runtime error. |
1094 | |
a5222a85 |
1095 | A bug that may have caused data loss when more than one disk block |
1096 | happens to be read from the database in a single FETCH() has been |
1097 | fixed. |
1098 | |
06ef4121 |
1099 | =item Time::Local |
1100 | |
1101 | The timelocal() and timegm() functions used to silently return bogus |
1102 | results when the date exceeded the machine's integer range. They |
a5222a85 |
1103 | now consistently croak() if the date falls in an unsupported range. |
06ef4121 |
1104 | |
8fe0a5c4 |
1105 | =item Win32 |
1106 | |
1107 | The error return value in list context has been changed for all functions |
14218588 |
1108 | that return a list of values. Previously these functions returned a list |
1109 | with a single element C<undef> if an error occurred. Now these functions |
1110 | return the empty list in these situations. This applies to the following |
8fe0a5c4 |
1111 | functions: |
1112 | |
14218588 |
1113 | Win32::FsType |
1114 | Win32::GetOSVersion |
8fe0a5c4 |
1115 | |
1116 | The remaining functions are unchanged and continue to return C<undef> on |
1117 | error even in list context. |
1118 | |
1119 | The Win32::SetLastError(ERROR) function has been added as a complement |
1120 | to the Win32::GetLastError() function. |
1121 | |
1122 | The new Win32::GetFullPathName(FILENAME) returns the full absolute |
14218588 |
1123 | pathname for FILENAME in scalar context. In list context it returns |
1124 | a two-element list containing the fully qualified directory name and |
8fe0a5c4 |
1125 | the filename. |
1126 | |
9fe6733a |
1127 | =item DBM Filters |
1128 | |
1129 | A new feature called "DBM Filters" has been added to all the |
14218588 |
1130 | DBM modules--DB_File, GDBM_File, NDBM_File, ODBM_File, and SDBM_File. |
1131 | DBM Filters add four new methods to each DBM module: |
9fe6733a |
1132 | |
1133 | filter_store_key |
1134 | filter_store_value |
1135 | filter_fetch_key |
1136 | filter_fetch_value |
1137 | |
14218588 |
1138 | These can be used to filter key-value pairs before the pairs are |
9fe6733a |
1139 | written to the database or just after they are read from the database. |
1140 | See L<perldbmfilter> for further information. |
1141 | |
b7d8191e |
1142 | =back |
3e8c4fa0 |
1143 | |
1144 | =head2 Pragmata |
1145 | |
09bef843 |
1146 | C<use attrs> is now obsolescent, and is only provided for |
1147 | backward-compatibility. It's been replaced by the C<sub : attributes> |
1148 | syntax. See L<perlsub/"Subroutine Attributes"> and L<attributes>. |
1149 | |
14218588 |
1150 | C<use utf8> to enable UTF-8 and Unicode support. |
43165c05 |
1151 | |
1152 | C<use caller 'encoding'> allows modules to inherit pragmatic attributes |
1153 | from the caller's context. C<encoding> is currently the only supported |
1154 | attribute. |
9d73390d |
1155 | |
4438c4b7 |
1156 | Lexical warnings pragma, C<use warnings;>, to control optional warnings. |
a5222a85 |
1157 | See L<perllexwarn>. |
6c67e1bb |
1158 | |
14218588 |
1159 | C<use filetest> to control the behaviour of filetests (C<-r> C<-w> ...). |
6c67e1bb |
1160 | Currently only one subpragma implemented, "use filetest 'access';", |
14218588 |
1161 | that enables the use of access(2) or equivalent to check |
6c67e1bb |
1162 | permissions instead of using stat(2) as usual. This matters |
14218588 |
1163 | in filesystems where there are ACLs (access control lists): the |
1164 | stat(2) might lie, but access(2) knows better. |
6c67e1bb |
1165 | |
ba8251e8 |
1166 | =head1 Utility Changes |
1167 | |
a5222a85 |
1168 | =head2 h2ph |
1169 | |
1170 | [TODO - Kurt Starsinic <kstar@chapin.edu>] |
1171 | |
1172 | =head2 perlcc |
1173 | |
1174 | C<perlcc> now supports the C and Bytecode backends. By default, |
1175 | it generates output from the simple C backend rather than the |
1176 | optimized C backend. |
1177 | |
1178 | Support for non-Unix platforms has been improved. |
1179 | |
1180 | =head2 h2xs |
1181 | |
1182 | change#4232 |
1183 | [TODO - Ilya Zakharevich <ilya@math.ohio-state.edu>] |
e02fdbd2 |
1184 | |
ba8251e8 |
1185 | =head1 Documentation Changes |
1186 | |
5fdc711f |
1187 | =over 4 |
1188 | |
1189 | =item perlopentut.pod |
f8284313 |
1190 | |
5fdc711f |
1191 | A tutorial on using open() effectively. |
1192 | |
1193 | =item perlreftut.pod |
1194 | |
1195 | A tutorial that introduces the essentials of references. |
1196 | |
14218588 |
1197 | =item perltootc.pod |
1198 | |
1199 | A tutorial on managing class data for object modules. |
1200 | |
a5222a85 |
1201 | =item perlcompile.pod |
1202 | |
1203 | An introduction to using the Perl Compiler suite. |
1204 | |
5fdc711f |
1205 | =back |
e02fdbd2 |
1206 | |
ba8251e8 |
1207 | =head1 New Diagnostics |
1208 | |
09bef843 |
1209 | =item "my sub" not yet implemented |
1210 | |
1211 | (F) Lexically scoped subroutines are not yet implemented. Don't try that |
1212 | yet. |
1213 | |
1214 | =item %s package attribute may clash with future reserved word: %s |
1215 | |
1216 | (W) A lowercase attribute name was used that had a package-specific handler. |
1217 | That name might have a meaning to Perl itself some day, even though it |
1218 | doesn't yet. Perhaps you should use a mixed-case attribute name, instead. |
1219 | See L<attributes>. |
1220 | |
6b121555 |
1221 | =item /%s/: Unrecognized escape \\%c passed through |
1222 | |
1223 | (W) You used a backslash-character combination which is not recognized |
7711098a |
1224 | by Perl. This combination appears in an interpolated variable or a |
6b121555 |
1225 | C<'>-delimited regular expression. |
1226 | |
af8c498a |
1227 | =item Filehandle %s opened only for output |
6b121555 |
1228 | |
af8c498a |
1229 | (W) You tried to read from a filehandle opened only for writing. If you |
1230 | intended it to be a read-write filehandle, you needed to open it with |
1231 | "+E<lt>" or "+E<gt>" or "+E<gt>E<gt>" instead of with "E<lt>" or nothing. If |
1232 | you intended only to read from the file, use "E<lt>". See |
1233 | L<perlfunc/open>. |
e02fdbd2 |
1234 | |
09bef843 |
1235 | =item Invalid %s attribute: %s |
1236 | |
1237 | The indicated attribute for a subroutine or variable was not recognized |
1238 | by Perl or by a user-supplied handler. See L<attributes>. |
1239 | |
1240 | =item Invalid %s attributes: %s |
1241 | |
1242 | The indicated attributes for a subroutine or variable were not recognized |
1243 | by Perl or by a user-supplied handler. See L<attributes>. |
1244 | |
1245 | =item Invalid separator character %s in attribute list |
1246 | |
1247 | (F) Something other than a comma or whitespace was seen between the |
1248 | elements of an attribute list. If the previous attribute |
1249 | had a parenthesised parameter list, perhaps that list was terminated |
1250 | too soon. See L<attributes>. |
1251 | |
06eaf0bc |
1252 | =item Missing command in piped open |
1253 | |
1254 | (W) You used the C<open(FH, "| command")> or C<open(FH, "command |")> |
1255 | construction, but the command was missing or blank. |
1256 | |
09bef843 |
1257 | =item Missing name in "my sub" |
1258 | |
1259 | (F) The reserved syntax for lexically scoped subroutines requires that they |
1260 | have a name with which they can be found. |
1261 | |
af8c498a |
1262 | =item Unrecognized escape \\%c passed through |
1263 | |
1264 | (W) You used a backslash-character combination which is not recognized |
1265 | by Perl. |
1266 | |
09bef843 |
1267 | =item Unterminated attribute parameter in attribute list |
1268 | |
1269 | (F) The lexer saw an opening (left) parenthesis character while parsing an |
1270 | attribute list, but the matching closing (right) parenthesis |
1271 | character was not found. You may need to add (or remove) a backslash |
1272 | character to get your parentheses to balance. See L<attributes>. |
1273 | |
1274 | =item Unterminated attribute list |
1275 | |
1276 | (F) The lexer found something other than a simple identifier at the start |
1277 | of an attribute, and it wasn't a semicolon or the start of a |
1278 | block. Perhaps you terminated the parameter list of the previous attribute |
1279 | too soon. See L<attributes>. |
1280 | |
f10b0346 |
1281 | =item defined(@array) is deprecated |
69794302 |
1282 | |
1283 | (D) defined() is not usually useful on arrays because it checks for an |
1284 | undefined I<scalar> value. If you want to see if the array is empty, |
1285 | just use C<if (@array) { # not empty }> for example. |
1286 | |
f10b0346 |
1287 | =item defined(%hash) is deprecated |
69794302 |
1288 | |
1289 | (D) defined() is not usually useful on hashes because it checks for an |
1290 | undefined I<scalar> value. If you want to see if the hash is empty, |
1291 | just use C<if (%hash) { # not empty }> for example. |
1292 | |
09bef843 |
1293 | =item Invalid separator character %s in subroutine attribute list |
1294 | |
1295 | (F) Something other than a comma or whitespace was seen between the |
1296 | elements of a subroutine attribute list. If the previous attribute |
1297 | had a parenthesised parameter list, perhaps that list was terminated |
1298 | too soon. |
1299 | |
6bc102ca |
1300 | =item Possible Y2K bug: %s |
1301 | |
1302 | (W) You are concatenating the number 19 with another number, which |
1303 | could be a potential Year 2000 problem. |
1304 | |
09bef843 |
1305 | =item Unterminated attribute parameter in subroutine attribute list |
1306 | |
1307 | (F) The lexer saw an opening (left) parenthesis character while parsing a |
1308 | subroutine attribute list, but the matching closing (right) parenthesis |
1309 | character was not found. You may need to add (or remove) a backslash |
1310 | character to get your parentheses to balance. |
1311 | |
1312 | =item Unterminated subroutine attribute list |
1313 | |
1314 | (F) The lexer found something other than a simple identifier at the start |
1315 | of a subroutine attribute, and it wasn't a semicolon or the start of a |
1316 | block. Perhaps you terminated the parameter list of the previous attribute |
1317 | too soon. |
1318 | |
eb6e2d6f |
1319 | =item /%s/ should probably be written as "%s" |
1320 | |
1321 | (W) You have used a pattern where Perl expected to find a string, |
1322 | like in the first argument to C<join>. Perl will treat the true |
1323 | or false result of matching the pattern against $_ as the string, |
1324 | which is probably not what you had in mind. |
1325 | |
a5222a85 |
1326 | =item %s() called too early to check prototype |
ba8251e8 |
1327 | |
a5222a85 |
1328 | (W) You've called a function that has a prototype before the parser saw a |
1329 | definition or declaration for it, and Perl could not check that the call |
1330 | conforms to the prototype. You need to either add an early prototype |
1331 | declaration for the subroutine in question, or move the subroutine |
1332 | definition ahead of the call to get proper prototype checking. Alternatively, |
1333 | if you are certain that you're calling the function correctly, you may put |
1334 | an ampersand before the name to avoid the warning. See L<perlsub>. |
27806c82 |
1335 | |
a5222a85 |
1336 | =head1 Obsolete Diagnostics |
3175b8cd |
1337 | |
a5222a85 |
1338 | Todo. |
3175b8cd |
1339 | |
ba8251e8 |
1340 | =head1 BUGS |
1341 | |
1342 | If you find what you think is a bug, you might check the headers of |
14218588 |
1343 | articles recently posted to the comp.lang.perl.misc newsgroup. |
ba8251e8 |
1344 | There may also be information at http://www.perl.com/perl/, the Perl |
1345 | Home Page. |
1346 | |
1347 | If you believe you have an unreported bug, please run the B<perlbug> |
14218588 |
1348 | program included with your release. Make sure to trim your bug down |
ba8251e8 |
1349 | to a tiny but sufficient test case. Your bug report, along with the |
14218588 |
1350 | output of C<perl -V>, will be sent off to perlbug@perl.com to be |
ba8251e8 |
1351 | analysed by the Perl porting team. |
1352 | |
1353 | =head1 SEE ALSO |
1354 | |
1355 | The F<Changes> file for exhaustive details on what changed. |
1356 | |
1357 | The F<INSTALL> file for how to build Perl. |
1358 | |
1359 | The F<README> file for general stuff. |
1360 | |
1361 | The F<Artistic> and F<Copying> files for copyright information. |
1362 | |
1363 | =head1 HISTORY |
1364 | |
a5222a85 |
1365 | Written by Gurusamy Sarathy <F<gsar@activestate.com>>, with many |
1366 | contributions from The Perl Porters. |
ba8251e8 |
1367 | |
1368 | Send omissions or corrections to <F<perlbug@perl.com>>. |
1369 | |
1370 | =cut |