1PERL592DELTA(1) Perl Programmers Reference Guide PERL592DELTA(1)
2
3
4
6 perl592delta - what is new for perl v5.9.2
7
9 This document describes differences between the 5.9.1 and the 5.9.2
10 development releases. See perl590delta and perl591delta for the
11 differences between 5.8.0 and 5.9.1.
12
14 Packing and UTF-8 strings
15 The semantics of pack() and unpack() regarding UTF-8-encoded data has
16 been changed. Processing is now by default character per character
17 instead of byte per byte on the underlying encoding. Notably, code that
18 used things like "pack("a*", $string)" to see through the encoding of
19 string will now simply get back the original $string. Packed strings
20 can also get upgraded during processing when you store upgraded
21 characters. You can get the old behaviour by using "use bytes".
22
23 To be consistent with pack(), the "C0" in unpack() templates indicates
24 that the data is to be processed in character mode, i.e. character by
25 character; on the contrary, "U0" in unpack() indicates UTF-8 mode,
26 where the packed string is processed in its UTF-8-encoded Unicode form
27 on a byte by byte basis. This is reversed with regard to perl 5.8.X.
28
29 Moreover, "C0" and "U0" can also be used in pack() templates to specify
30 respectively character and byte modes.
31
32 "C0" and "U0" in the middle of a pack or unpack format now switch to
33 the specified encoding mode, honoring parens grouping. Previously,
34 parens were ignored.
35
36 Also, there is a new pack() character format, "W", which is intended to
37 replace the old "C". "C" is kept for unsigned chars coded as bytes in
38 the strings internal representation. "W" represents unsigned (logical)
39 character values, which can be greater than 255. It is therefore more
40 robust when dealing with potentially UTF-8-encoded data (as "C" will
41 wrap values outside the range 0..255, and not respect the string
42 encoding).
43
44 In practice, that means that pack formats are now encoding-neutral,
45 except "C".
46
47 For consistency, "A" in unpack() format now trims all Unicode
48 whitespace from the end of the string. Before perl 5.9.2, it used to
49 strip only the classical ASCII space characters.
50
51 Miscellaneous
52 The internal dump output has been improved, so that non-printable
53 characters such as newline and backspace are output in "\x" notation,
54 rather than octal.
55
56 The -C option can no longer be used on the "#!" line. It wasn't working
57 there anyway.
58
60 Malloc wrapping
61 Perl can now be built to detect attempts to assign pathologically large
62 chunks of memory. Previously such assignments would suffer from
63 integer wrap-around during size calculations causing a misallocation,
64 which would crash perl, and could theoretically be used for "stack
65 smashing" attacks. The wrapping defaults to enabled on platforms where
66 we know it works (most AIX configurations, BSDi, Darwin, DEC OSF/1,
67 FreeBSD, HP-UX, GNU Linux, OpenBSD, Solaris, VMS and most Win32
68 compilers) and defaults to disabled on other platforms.
69
70 Unicode Character Database 4.0.1
71 The copy of the Unicode Character Database included in Perl 5.9 has
72 been updated to 4.0.1 from 4.0.0.
73
74 suidperl less insecure
75 Paul Szabo has analysed and patched "suidperl" to remove existing known
76 insecurities. Currently there are no known holes in "suidperl", but
77 previous experience shows that we cannot be confident that these were
78 the last. You may no longer invoke the set uid perl directly, so to
79 preserve backwards compatibility with scripts that invoke
80 #!/usr/bin/suidperl the only set uid binary is now "sperl5.9."n
81 ("sperl5.9.2" for this release). "suidperl" is installed as a hard link
82 to "perl"; both "suidperl" and "perl" will invoke "sperl5.9.2"
83 automatically the set uid binary, so this change should be completely
84 transparent.
85
86 For new projects the core perl team would strongly recommend that you
87 use dedicated, single purpose security tools such as "sudo" in
88 preference to "suidperl".
89
90 PERLIO_DEBUG
91 The "PERLIO_DEBUG" environment variable has no longer any effect for
92 setuid scripts and for scripts run with -T.
93
94 Moreover, with a thread-enabled perl, using "PERLIO_DEBUG" could lead
95 to an internal buffer overflow. This has been fixed.
96
97 Formats
98 In addition to bug fixes, "format"'s features have been enhanced. See
99 perlform.
100
101 Unicode Character Classes
102 Perl's regular expression engine now contains support for matching on
103 the intersection of two Unicode character classes. You can also now
104 refer to user-defined character classes from within other user defined
105 character classes.
106
107 Byte-order modifiers for pack() and unpack()
108 There are two new byte-order modifiers, ">" (big-endian) and "<"
109 (little-endian), that can be appended to most pack() and unpack()
110 template characters and groups to force a certain byte-order for that
111 type or group. See "pack" in perlfunc and perlpacktut for details.
112
113 Byte count feature in pack()
114 A new pack() template character, ".", returns the number of characters
115 read so far.
116
117 New variables
118 A new variable, ${^RE_DEBUG_FLAGS}, controls what debug flags are in
119 effect for the regular expression engine when running under "use re
120 "debug"". See re for details.
121
122 A new variable ${^UTF8LOCALE} indicates where an UTF-8 locale was
123 detected by perl at startup.
124
126 New modules
127 · "encoding::warnings", by Audrey Tang, is a module to emit warnings
128 whenever an ASCII character string containing high-bit bytes is
129 implicitly converted into UTF-8.
130
131 · "Module::CoreList", by Richard Clamp, is a small handy module that
132 tells you what versions of core modules ship with any versions of
133 Perl 5. It comes with a command-line frontend, "corelist".
134
135 Updated And Improved Modules and Pragmata
136 Dual-lived modules have been updated to be kept up-to-date with respect
137 to CPAN.
138
139 The dual-lived modules which contain an "_" in their version number are
140 actually ahead of the corresponding CPAN release.
141
142 B::Concise
143 "B::Concise" was significantly improved.
144
145 Socket
146 There is experimental support for Linux abstract Unix domain
147 sockets.
148
149 Sys::Syslog
150 "syslog()" can now use numeric constants for facility names and
151 priorities, in addition to strings.
152
153 threads
154 Detached threads are now also supported on Windows.
155
157 · The "corelist" utility is now installed with perl (see "New
158 modules" above).
159
160 · "h2ph" and "h2xs" have been made a bit more robust with regard to
161 "modern" C code.
162
163 · Several bugs have been fixed in "find2perl", regarding "-exec" and
164 "-eval". Also the options "-path", "-ipath" and "-iname" have been
165 added.
166
167 · The Perl debugger can now save all debugger commands for sourcing
168 later; notably, it can now emulate stepping backwards, by
169 restarting and rerunning all bar the last command from a saved
170 command history.
171
172 It can also display the parent inheritance tree of a given class.
173
174 Perl has a new -dt command-line flag, which enables threads support
175 in the debugger.
176
178 · Unicode case mappings ("/i", "lc", "uc", etc) are faster.
179
180 · "@a = sort @a" was optimized to do in-place sort. Likewise,
181 "reverse sort ..." is now optimized to sort in reverse, avoiding
182 the generation of a temporary intermediate list.
183
184 · Unnecessary assignments are optimised away in
185
186 my $s = undef;
187 my @a = ();
188 my %h = ();
189
190 · "map" in scalar context is now optimized.
191
192 · The regexp engine now implements the trie optimization : it's able
193 to factorize common prefixes and suffixes in regular expressions. A
194 new special variable, ${^RE_TRIE_MAXBUF}, has been added to fine-
195 tune this optimization.
196
198 Run-time customization of @INC can be enabled by passing the
199 "-Dusesitecustomize" flag to configure. When enabled, this will make
200 perl run $sitelibexp/sitecustomize.pl before anything else. This
201 script can then be set up to add additional entries to @INC.
202
203 There is alpha support for relocatable @INC entries.
204
205 Perl should build on Interix and on GNU/kFreeBSD.
206
208 Most of those bugs were reported in the perl 5.8.x maintenance track.
209 Notably, quite a few utf8 bugs were fixed, and several memory leaks
210 were suppressed. The perl58Xdelta manpages have more details on them.
211
212 Development-only bug fixes include :
213
214 $Foo::_ was wrongly forced as $main::_.
215
217 A new warning, "!=~ should be !~", is emitted to prevent this
218 misspelling of the non-matching operator.
219
220 The warning Newline in left-justified string has been removed.
221
222 The error Too late for "-T" option has been reformulated to be more
223 descriptive.
224
225 There is a new compilation error, Illegal declaration of subroutine,
226 for an obscure case of syntax errors.
227
228 The diagnostic output of Carp has been changed slightly, to add a space
229 after the comma between arguments. This makes it much easier for tools
230 such as web browsers to wrap it, but might confuse any automatic tools
231 which perform detailed parsing of Carp output.
232
233 "perl -V" has several improvements, making it more useable from shell
234 scripts to get the value of configuration variables. See perlrun for
235 details.
236
238 The perl core has been refactored and reorganised in several places.
239 In short, this release will not be binary compatible with any previous
240 perl release.
241
243 For threaded builds, ext/threads/shared/t/wait.t has been reported to
244 fail some tests on HP-UX 10.20.
245
246 Net::Ping might fail some tests on HP-UX 11.00 with the latest OS
247 upgrades.
248
249 t/io/dup.t, t/io/open.t and lib/ExtUtils/t/Constant.t fail some tests
250 on some BSD flavours.
251
253 The current plan for perl 5.9.3 is to add CPANPLUS as a core module.
254 More regular expression optimizations are also in the works.
255
256 It is planned to release a development version of perl more frequently,
257 i.e. each time something major changes.
258
260 If you find what you think is a bug, you might check the articles
261 recently posted to the comp.lang.perl.misc newsgroup and the perl bug
262 database at http://bugs.perl.org/ . There may also be information at
263 http://www.perl.org/ , the Perl Home Page.
264
265 If you believe you have an unreported bug, please run the perlbug
266 program included with your release. Be sure to trim your bug down to a
267 tiny but sufficient test case. Your bug report, along with the output
268 of "perl -V", will be sent off to perlbug@perl.org to be analysed by
269 the Perl porting team.
270
272 The Changes file for exhaustive details on what changed.
273
274 The INSTALL file for how to build Perl.
275
276 The README file for general stuff.
277
278 The Artistic and Copying files for copyright information.
279
280
281
282perl v5.10.1 2009-02-12 PERL592DELTA(1)