1*0Sstevel@tonic-gate=head1 NAME 2*0Sstevel@tonic-gate 3*0Sstevel@tonic-gateperl5005delta - what's new for perl5.005 4*0Sstevel@tonic-gate 5*0Sstevel@tonic-gate=head1 DESCRIPTION 6*0Sstevel@tonic-gate 7*0Sstevel@tonic-gateThis document describes differences between the 5.004 release and this one. 8*0Sstevel@tonic-gate 9*0Sstevel@tonic-gate=head1 About the new versioning system 10*0Sstevel@tonic-gate 11*0Sstevel@tonic-gatePerl is now developed on two tracks: a maintenance track that makes 12*0Sstevel@tonic-gatesmall, safe updates to released production versions with emphasis on 13*0Sstevel@tonic-gatecompatibility; and a development track that pursues more aggressive 14*0Sstevel@tonic-gateevolution. Maintenance releases (which should be considered production 15*0Sstevel@tonic-gatequality) have subversion numbers that run from C<1> to C<49>, and 16*0Sstevel@tonic-gatedevelopment releases (which should be considered "alpha" quality) run 17*0Sstevel@tonic-gatefrom C<50> to C<99>. 18*0Sstevel@tonic-gate 19*0Sstevel@tonic-gatePerl 5.005 is the combined product of the new dual-track development 20*0Sstevel@tonic-gatescheme. 21*0Sstevel@tonic-gate 22*0Sstevel@tonic-gate=head1 Incompatible Changes 23*0Sstevel@tonic-gate 24*0Sstevel@tonic-gate=head2 WARNING: This version is not binary compatible with Perl 5.004. 25*0Sstevel@tonic-gate 26*0Sstevel@tonic-gateStarting with Perl 5.004_50 there were many deep and far-reaching changes 27*0Sstevel@tonic-gateto the language internals. If you have dynamically loaded extensions 28*0Sstevel@tonic-gatethat you built under perl 5.003 or 5.004, you can continue to use them 29*0Sstevel@tonic-gatewith 5.004, but you will need to rebuild and reinstall those extensions 30*0Sstevel@tonic-gateto use them 5.005. See F<INSTALL> for detailed instructions on how to 31*0Sstevel@tonic-gateupgrade. 32*0Sstevel@tonic-gate 33*0Sstevel@tonic-gate=head2 Default installation structure has changed 34*0Sstevel@tonic-gate 35*0Sstevel@tonic-gateThe new Configure defaults are designed to allow a smooth upgrade from 36*0Sstevel@tonic-gate5.004 to 5.005, but you should read F<INSTALL> for a detailed 37*0Sstevel@tonic-gatediscussion of the changes in order to adapt them to your system. 38*0Sstevel@tonic-gate 39*0Sstevel@tonic-gate=head2 Perl Source Compatibility 40*0Sstevel@tonic-gate 41*0Sstevel@tonic-gateWhen none of the experimental features are enabled, there should be 42*0Sstevel@tonic-gatevery few user-visible Perl source compatibility issues. 43*0Sstevel@tonic-gate 44*0Sstevel@tonic-gateIf threads are enabled, then some caveats apply. C<@_> and C<$_> become 45*0Sstevel@tonic-gatelexical variables. The effect of this should be largely transparent to 46*0Sstevel@tonic-gatethe user, but there are some boundary conditions under which user will 47*0Sstevel@tonic-gateneed to be aware of the issues. For example, C<local(@_)> results in 48*0Sstevel@tonic-gatea "Can't localize lexical variable @_ ..." message. This may be enabled 49*0Sstevel@tonic-gatein a future version. 50*0Sstevel@tonic-gate 51*0Sstevel@tonic-gateSome new keywords have been introduced. These are generally expected to 52*0Sstevel@tonic-gatehave very little impact on compatibility. See L<New C<INIT> keyword>, 53*0Sstevel@tonic-gateL<New C<lock> keyword>, and L<New C<qrE<sol>E<sol>> operator>. 54*0Sstevel@tonic-gate 55*0Sstevel@tonic-gateCertain barewords are now reserved. Use of these will provoke a warning 56*0Sstevel@tonic-gateif you have asked for them with the C<-w> switch. 57*0Sstevel@tonic-gateSee L<C<our> is now a reserved word>. 58*0Sstevel@tonic-gate 59*0Sstevel@tonic-gate=head2 C Source Compatibility 60*0Sstevel@tonic-gate 61*0Sstevel@tonic-gateThere have been a large number of changes in the internals to support 62*0Sstevel@tonic-gatethe new features in this release. 63*0Sstevel@tonic-gate 64*0Sstevel@tonic-gate=over 4 65*0Sstevel@tonic-gate 66*0Sstevel@tonic-gate=item * 67*0Sstevel@tonic-gate 68*0Sstevel@tonic-gateCore sources now require ANSI C compiler 69*0Sstevel@tonic-gate 70*0Sstevel@tonic-gateAn ANSI C compiler is now B<required> to build perl. See F<INSTALL>. 71*0Sstevel@tonic-gate 72*0Sstevel@tonic-gate=item * 73*0Sstevel@tonic-gate 74*0Sstevel@tonic-gateAll Perl global variables must now be referenced with an explicit prefix 75*0Sstevel@tonic-gate 76*0Sstevel@tonic-gateAll Perl global variables that are visible for use by extensions now 77*0Sstevel@tonic-gatehave a C<PL_> prefix. New extensions should C<not> refer to perl globals 78*0Sstevel@tonic-gateby their unqualified names. To preserve sanity, we provide limited 79*0Sstevel@tonic-gatebackward compatibility for globals that are being widely used like 80*0Sstevel@tonic-gateC<sv_undef> and C<na> (which should now be written as C<PL_sv_undef>, 81*0Sstevel@tonic-gateC<PL_na> etc.) 82*0Sstevel@tonic-gate 83*0Sstevel@tonic-gateIf you find that your XS extension does not compile anymore because a 84*0Sstevel@tonic-gateperl global is not visible, try adding a C<PL_> prefix to the global 85*0Sstevel@tonic-gateand rebuild. 86*0Sstevel@tonic-gate 87*0Sstevel@tonic-gateIt is strongly recommended that all functions in the Perl API that don't 88*0Sstevel@tonic-gatebegin with C<perl> be referenced with a C<Perl_> prefix. The bare function 89*0Sstevel@tonic-gatenames without the C<Perl_> prefix are supported with macros, but this 90*0Sstevel@tonic-gatesupport may cease in a future release. 91*0Sstevel@tonic-gate 92*0Sstevel@tonic-gateSee L<perlapi>. 93*0Sstevel@tonic-gate 94*0Sstevel@tonic-gate=item * 95*0Sstevel@tonic-gate 96*0Sstevel@tonic-gateEnabling threads has source compatibility issues 97*0Sstevel@tonic-gate 98*0Sstevel@tonic-gatePerl built with threading enabled requires extensions to use the new 99*0Sstevel@tonic-gateC<dTHR> macro to initialize the handle to access per-thread data. 100*0Sstevel@tonic-gateIf you see a compiler error that talks about the variable C<thr> not 101*0Sstevel@tonic-gatebeing declared (when building a module that has XS code), you need 102*0Sstevel@tonic-gateto add C<dTHR;> at the beginning of the block that elicited the error. 103*0Sstevel@tonic-gate 104*0Sstevel@tonic-gateThe API function C<perl_get_sv("@",FALSE)> should be used instead of 105*0Sstevel@tonic-gatedirectly accessing perl globals as C<GvSV(errgv)>. The API call is 106*0Sstevel@tonic-gatebackward compatible with existing perls and provides source compatibility 107*0Sstevel@tonic-gatewith threading is enabled. 108*0Sstevel@tonic-gate 109*0Sstevel@tonic-gateSee L<"C Source Compatibility"> for more information. 110*0Sstevel@tonic-gate 111*0Sstevel@tonic-gate=back 112*0Sstevel@tonic-gate 113*0Sstevel@tonic-gate=head2 Binary Compatibility 114*0Sstevel@tonic-gate 115*0Sstevel@tonic-gateThis version is NOT binary compatible with older versions. All extensions 116*0Sstevel@tonic-gatewill need to be recompiled. Further binaries built with threads enabled 117*0Sstevel@tonic-gateare incompatible with binaries built without. This should largely be 118*0Sstevel@tonic-gatetransparent to the user, as all binary incompatible configurations have 119*0Sstevel@tonic-gatetheir own unique architecture name, and extension binaries get installed at 120*0Sstevel@tonic-gateunique locations. This allows coexistence of several configurations in 121*0Sstevel@tonic-gatethe same directory hierarchy. See F<INSTALL>. 122*0Sstevel@tonic-gate 123*0Sstevel@tonic-gate=head2 Security fixes may affect compatibility 124*0Sstevel@tonic-gate 125*0Sstevel@tonic-gateA few taint leaks and taint omissions have been corrected. This may lead 126*0Sstevel@tonic-gateto "failure" of scripts that used to work with older versions. Compiling 127*0Sstevel@tonic-gatewith -DINCOMPLETE_TAINTS provides a perl with minimal amounts of changes 128*0Sstevel@tonic-gateto the tainting behavior. But note that the resulting perl will have 129*0Sstevel@tonic-gateknown insecurities. 130*0Sstevel@tonic-gate 131*0Sstevel@tonic-gateOneliners with the C<-e> switch do not create temporary files anymore. 132*0Sstevel@tonic-gate 133*0Sstevel@tonic-gate=head2 Relaxed new mandatory warnings introduced in 5.004 134*0Sstevel@tonic-gate 135*0Sstevel@tonic-gateMany new warnings that were introduced in 5.004 have been made 136*0Sstevel@tonic-gateoptional. Some of these warnings are still present, but perl's new 137*0Sstevel@tonic-gatefeatures make them less often a problem. See L<New Diagnostics>. 138*0Sstevel@tonic-gate 139*0Sstevel@tonic-gate=head2 Licensing 140*0Sstevel@tonic-gate 141*0Sstevel@tonic-gatePerl has a new Social Contract for contributors. See F<Porting/Contract>. 142*0Sstevel@tonic-gate 143*0Sstevel@tonic-gateThe license included in much of the Perl documentation has changed. 144*0Sstevel@tonic-gateMost of the Perl documentation was previously under the implicit GNU 145*0Sstevel@tonic-gateGeneral Public License or the Artistic License (at the user's choice). 146*0Sstevel@tonic-gateNow much of the documentation unambiguously states the terms under which 147*0Sstevel@tonic-gateit may be distributed. Those terms are in general much less restrictive 148*0Sstevel@tonic-gatethan the GNU GPL. See L<perl> and the individual perl manpages listed 149*0Sstevel@tonic-gatetherein. 150*0Sstevel@tonic-gate 151*0Sstevel@tonic-gate=head1 Core Changes 152*0Sstevel@tonic-gate 153*0Sstevel@tonic-gate 154*0Sstevel@tonic-gate=head2 Threads 155*0Sstevel@tonic-gate 156*0Sstevel@tonic-gateWARNING: Threading is considered an B<experimental> feature. Details of the 157*0Sstevel@tonic-gateimplementation may change without notice. There are known limitations 158*0Sstevel@tonic-gateand some bugs. These are expected to be fixed in future versions. 159*0Sstevel@tonic-gate 160*0Sstevel@tonic-gateSee F<README.threads>. 161*0Sstevel@tonic-gate 162*0Sstevel@tonic-gate=head2 Compiler 163*0Sstevel@tonic-gate 164*0Sstevel@tonic-gateWARNING: The Compiler and related tools are considered B<experimental>. 165*0Sstevel@tonic-gateFeatures may change without notice, and there are known limitations 166*0Sstevel@tonic-gateand bugs. Since the compiler is fully external to perl, the default 167*0Sstevel@tonic-gateconfiguration will build and install it. 168*0Sstevel@tonic-gate 169*0Sstevel@tonic-gateThe Compiler produces three different types of transformations of a 170*0Sstevel@tonic-gateperl program. The C backend generates C code that captures perl's state 171*0Sstevel@tonic-gatejust before execution begins. It eliminates the compile-time overheads 172*0Sstevel@tonic-gateof the regular perl interpreter, but the run-time performance remains 173*0Sstevel@tonic-gatecomparatively the same. The CC backend generates optimized C code 174*0Sstevel@tonic-gateequivalent to the code path at run-time. The CC backend has greater 175*0Sstevel@tonic-gatepotential for big optimizations, but only a few optimizations are 176*0Sstevel@tonic-gateimplemented currently. The Bytecode backend generates a platform 177*0Sstevel@tonic-gateindependent bytecode representation of the interpreter's state 178*0Sstevel@tonic-gatejust before execution. Thus, the Bytecode back end also eliminates 179*0Sstevel@tonic-gatemuch of the compilation overhead of the interpreter. 180*0Sstevel@tonic-gate 181*0Sstevel@tonic-gateThe compiler comes with several valuable utilities. 182*0Sstevel@tonic-gate 183*0Sstevel@tonic-gateC<B::Lint> is an experimental module to detect and warn about suspicious 184*0Sstevel@tonic-gatecode, especially the cases that the C<-w> switch does not detect. 185*0Sstevel@tonic-gate 186*0Sstevel@tonic-gateC<B::Deparse> can be used to demystify perl code, and understand 187*0Sstevel@tonic-gatehow perl optimizes certain constructs. 188*0Sstevel@tonic-gate 189*0Sstevel@tonic-gateC<B::Xref> generates cross reference reports of all definition and use 190*0Sstevel@tonic-gateof variables, subroutines and formats in a program. 191*0Sstevel@tonic-gate 192*0Sstevel@tonic-gateC<B::Showlex> show the lexical variables used by a subroutine or file 193*0Sstevel@tonic-gateat a glance. 194*0Sstevel@tonic-gate 195*0Sstevel@tonic-gateC<perlcc> is a simple frontend for compiling perl. 196*0Sstevel@tonic-gate 197*0Sstevel@tonic-gateSee C<ext/B/README>, L<B>, and the respective compiler modules. 198*0Sstevel@tonic-gate 199*0Sstevel@tonic-gate=head2 Regular Expressions 200*0Sstevel@tonic-gate 201*0Sstevel@tonic-gatePerl's regular expression engine has been seriously overhauled, and 202*0Sstevel@tonic-gatemany new constructs are supported. Several bugs have been fixed. 203*0Sstevel@tonic-gate 204*0Sstevel@tonic-gateHere is an itemized summary: 205*0Sstevel@tonic-gate 206*0Sstevel@tonic-gate=over 4 207*0Sstevel@tonic-gate 208*0Sstevel@tonic-gate=item Many new and improved optimizations 209*0Sstevel@tonic-gate 210*0Sstevel@tonic-gateChanges in the RE engine: 211*0Sstevel@tonic-gate 212*0Sstevel@tonic-gate Unneeded nodes removed; 213*0Sstevel@tonic-gate Substrings merged together; 214*0Sstevel@tonic-gate New types of nodes to process (SUBEXPR)* and similar expressions 215*0Sstevel@tonic-gate quickly, used if the SUBEXPR has no side effects and matches 216*0Sstevel@tonic-gate strings of the same length; 217*0Sstevel@tonic-gate Better optimizations by lookup for constant substrings; 218*0Sstevel@tonic-gate Better search for constants substrings anchored by $ ; 219*0Sstevel@tonic-gate 220*0Sstevel@tonic-gateChanges in Perl code using RE engine: 221*0Sstevel@tonic-gate 222*0Sstevel@tonic-gate More optimizations to s/longer/short/; 223*0Sstevel@tonic-gate study() was not working; 224*0Sstevel@tonic-gate /blah/ may be optimized to an analogue of index() if $& $` $' not seen; 225*0Sstevel@tonic-gate Unneeded copying of matched-against string removed; 226*0Sstevel@tonic-gate Only matched part of the string is copying if $` $' were not seen; 227*0Sstevel@tonic-gate 228*0Sstevel@tonic-gate=item Many bug fixes 229*0Sstevel@tonic-gate 230*0Sstevel@tonic-gateNote that only the major bug fixes are listed here. See F<Changes> for others. 231*0Sstevel@tonic-gate 232*0Sstevel@tonic-gate Backtracking might not restore start of $3. 233*0Sstevel@tonic-gate No feedback if max count for * or + on "complex" subexpression 234*0Sstevel@tonic-gate was reached, similarly (but at compile time) for {3,34567} 235*0Sstevel@tonic-gate Primitive restrictions on max count introduced to decrease a 236*0Sstevel@tonic-gate possibility of a segfault; 237*0Sstevel@tonic-gate (ZERO-LENGTH)* could segfault; 238*0Sstevel@tonic-gate (ZERO-LENGTH)* was prohibited; 239*0Sstevel@tonic-gate Long REs were not allowed; 240*0Sstevel@tonic-gate /RE/g could skip matches at the same position after a 241*0Sstevel@tonic-gate zero-length match; 242*0Sstevel@tonic-gate 243*0Sstevel@tonic-gate=item New regular expression constructs 244*0Sstevel@tonic-gate 245*0Sstevel@tonic-gateThe following new syntax elements are supported: 246*0Sstevel@tonic-gate 247*0Sstevel@tonic-gate (?<=RE) 248*0Sstevel@tonic-gate (?<!RE) 249*0Sstevel@tonic-gate (?{ CODE }) 250*0Sstevel@tonic-gate (?i-x) 251*0Sstevel@tonic-gate (?i:RE) 252*0Sstevel@tonic-gate (?(COND)YES_RE|NO_RE) 253*0Sstevel@tonic-gate (?>RE) 254*0Sstevel@tonic-gate \z 255*0Sstevel@tonic-gate 256*0Sstevel@tonic-gate=item New operator for precompiled regular expressions 257*0Sstevel@tonic-gate 258*0Sstevel@tonic-gateSee L<New C<qrE<sol>E<sol>> operator>. 259*0Sstevel@tonic-gate 260*0Sstevel@tonic-gate=item Other improvements 261*0Sstevel@tonic-gate 262*0Sstevel@tonic-gate Better debugging output (possibly with colors), 263*0Sstevel@tonic-gate even from non-debugging Perl; 264*0Sstevel@tonic-gate RE engine code now looks like C, not like assembler; 265*0Sstevel@tonic-gate Behaviour of RE modifiable by `use re' directive; 266*0Sstevel@tonic-gate Improved documentation; 267*0Sstevel@tonic-gate Test suite significantly extended; 268*0Sstevel@tonic-gate Syntax [:^upper:] etc., reserved inside character classes; 269*0Sstevel@tonic-gate 270*0Sstevel@tonic-gate=item Incompatible changes 271*0Sstevel@tonic-gate 272*0Sstevel@tonic-gate (?i) localized inside enclosing group; 273*0Sstevel@tonic-gate $( is not interpolated into RE any more; 274*0Sstevel@tonic-gate /RE/g may match at the same position (with non-zero length) 275*0Sstevel@tonic-gate after a zero-length match (bug fix). 276*0Sstevel@tonic-gate 277*0Sstevel@tonic-gate=back 278*0Sstevel@tonic-gate 279*0Sstevel@tonic-gateSee L<perlre> and L<perlop>. 280*0Sstevel@tonic-gate 281*0Sstevel@tonic-gate=head2 Improved malloc() 282*0Sstevel@tonic-gate 283*0Sstevel@tonic-gateSee banner at the beginning of C<malloc.c> for details. 284*0Sstevel@tonic-gate 285*0Sstevel@tonic-gate=head2 Quicksort is internally implemented 286*0Sstevel@tonic-gate 287*0Sstevel@tonic-gatePerl now contains its own highly optimized qsort() routine. The new qsort() 288*0Sstevel@tonic-gateis resistant to inconsistent comparison functions, so Perl's C<sort()> will 289*0Sstevel@tonic-gatenot provoke coredumps any more when given poorly written sort subroutines. 290*0Sstevel@tonic-gate(Some C library C<qsort()>s that were being used before used to have this 291*0Sstevel@tonic-gateproblem.) In our testing, the new C<qsort()> required the minimal number 292*0Sstevel@tonic-gateof pair-wise compares on average, among all known C<qsort()> implementations. 293*0Sstevel@tonic-gate 294*0Sstevel@tonic-gateSee C<perlfunc/sort>. 295*0Sstevel@tonic-gate 296*0Sstevel@tonic-gate=head2 Reliable signals 297*0Sstevel@tonic-gate 298*0Sstevel@tonic-gatePerl's signal handling is susceptible to random crashes, because signals 299*0Sstevel@tonic-gatearrive asynchronously, and the Perl runtime is not reentrant at arbitrary 300*0Sstevel@tonic-gatetimes. 301*0Sstevel@tonic-gate 302*0Sstevel@tonic-gateHowever, one experimental implementation of reliable signals is available 303*0Sstevel@tonic-gatewhen threads are enabled. See C<Thread::Signal>. Also see F<INSTALL> for 304*0Sstevel@tonic-gatehow to build a Perl capable of threads. 305*0Sstevel@tonic-gate 306*0Sstevel@tonic-gate=head2 Reliable stack pointers 307*0Sstevel@tonic-gate 308*0Sstevel@tonic-gateThe internals now reallocate the perl stack only at predictable times. 309*0Sstevel@tonic-gateIn particular, magic calls never trigger reallocations of the stack, 310*0Sstevel@tonic-gatebecause all reentrancy of the runtime is handled using a "stack of stacks". 311*0Sstevel@tonic-gateThis should improve reliability of cached stack pointers in the internals 312*0Sstevel@tonic-gateand in XSUBs. 313*0Sstevel@tonic-gate 314*0Sstevel@tonic-gate=head2 More generous treatment of carriage returns 315*0Sstevel@tonic-gate 316*0Sstevel@tonic-gatePerl used to complain if it encountered literal carriage returns in 317*0Sstevel@tonic-gatescripts. Now they are mostly treated like whitespace within program text. 318*0Sstevel@tonic-gateInside string literals and here documents, literal carriage returns are 319*0Sstevel@tonic-gateignored if they occur paired with linefeeds, or get interpreted as whitespace 320*0Sstevel@tonic-gateif they stand alone. This behavior means that literal carriage returns 321*0Sstevel@tonic-gatein files should be avoided. You can get the older, more compatible (but 322*0Sstevel@tonic-gateless generous) behavior by defining the preprocessor symbol 323*0Sstevel@tonic-gateC<PERL_STRICT_CR> when building perl. Of course, all this has nothing 324*0Sstevel@tonic-gatewhatever to do with how escapes like C<\r> are handled within strings. 325*0Sstevel@tonic-gate 326*0Sstevel@tonic-gateNote that this doesn't somehow magically allow you to keep all text files 327*0Sstevel@tonic-gatein DOS format. The generous treatment only applies to files that perl 328*0Sstevel@tonic-gateitself parses. If your C compiler doesn't allow carriage returns in 329*0Sstevel@tonic-gatefiles, you may still be unable to build modules that need a C compiler. 330*0Sstevel@tonic-gate 331*0Sstevel@tonic-gate=head2 Memory leaks 332*0Sstevel@tonic-gate 333*0Sstevel@tonic-gateC<substr>, C<pos> and C<vec> don't leak memory anymore when used in lvalue 334*0Sstevel@tonic-gatecontext. Many small leaks that impacted applications that embed multiple 335*0Sstevel@tonic-gateinterpreters have been fixed. 336*0Sstevel@tonic-gate 337*0Sstevel@tonic-gate=head2 Better support for multiple interpreters 338*0Sstevel@tonic-gate 339*0Sstevel@tonic-gateThe build-time option C<-DMULTIPLICITY> has had many of the details 340*0Sstevel@tonic-gatereworked. Some previously global variables that should have been 341*0Sstevel@tonic-gateper-interpreter now are. With care, this allows interpreters to call 342*0Sstevel@tonic-gateeach other. See the C<PerlInterp> extension on CPAN. 343*0Sstevel@tonic-gate 344*0Sstevel@tonic-gate=head2 Behavior of local() on array and hash elements is now well-defined 345*0Sstevel@tonic-gate 346*0Sstevel@tonic-gateSee L<perlsub/"Temporary Values via local()">. 347*0Sstevel@tonic-gate 348*0Sstevel@tonic-gate=head2 C<%!> is transparently tied to the L<Errno> module 349*0Sstevel@tonic-gate 350*0Sstevel@tonic-gateSee L<perlvar>, and L<Errno>. 351*0Sstevel@tonic-gate 352*0Sstevel@tonic-gate=head2 Pseudo-hashes are supported 353*0Sstevel@tonic-gate 354*0Sstevel@tonic-gateSee L<perlref>. 355*0Sstevel@tonic-gate 356*0Sstevel@tonic-gate=head2 C<EXPR foreach EXPR> is supported 357*0Sstevel@tonic-gate 358*0Sstevel@tonic-gateSee L<perlsyn>. 359*0Sstevel@tonic-gate 360*0Sstevel@tonic-gate=head2 Keywords can be globally overridden 361*0Sstevel@tonic-gate 362*0Sstevel@tonic-gateSee L<perlsub>. 363*0Sstevel@tonic-gate 364*0Sstevel@tonic-gate=head2 C<$^E> is meaningful on Win32 365*0Sstevel@tonic-gate 366*0Sstevel@tonic-gateSee L<perlvar>. 367*0Sstevel@tonic-gate 368*0Sstevel@tonic-gate=head2 C<foreach (1..1000000)> optimized 369*0Sstevel@tonic-gate 370*0Sstevel@tonic-gateC<foreach (1..1000000)> is now optimized into a counting loop. It does 371*0Sstevel@tonic-gatenot try to allocate a 1000000-size list anymore. 372*0Sstevel@tonic-gate 373*0Sstevel@tonic-gate=head2 C<Foo::> can be used as implicitly quoted package name 374*0Sstevel@tonic-gate 375*0Sstevel@tonic-gateBarewords caused unintuitive behavior when a subroutine with the same 376*0Sstevel@tonic-gatename as a package happened to be defined. Thus, C<new Foo @args>, 377*0Sstevel@tonic-gateuse the result of the call to C<Foo()> instead of C<Foo> being treated 378*0Sstevel@tonic-gateas a literal. The recommended way to write barewords in the indirect 379*0Sstevel@tonic-gateobject slot is C<new Foo:: @args>. Note that the method C<new()> is 380*0Sstevel@tonic-gatecalled with a first argument of C<Foo>, not C<Foo::> when you do that. 381*0Sstevel@tonic-gate 382*0Sstevel@tonic-gate=head2 C<exists $Foo::{Bar::}> tests existence of a package 383*0Sstevel@tonic-gate 384*0Sstevel@tonic-gateIt was impossible to test for the existence of a package without 385*0Sstevel@tonic-gateactually creating it before. Now C<exists $Foo::{Bar::}> can be 386*0Sstevel@tonic-gateused to test if the C<Foo::Bar> namespace has been created. 387*0Sstevel@tonic-gate 388*0Sstevel@tonic-gate=head2 Better locale support 389*0Sstevel@tonic-gate 390*0Sstevel@tonic-gateSee L<perllocale>. 391*0Sstevel@tonic-gate 392*0Sstevel@tonic-gate=head2 Experimental support for 64-bit platforms 393*0Sstevel@tonic-gate 394*0Sstevel@tonic-gatePerl5 has always had 64-bit support on systems with 64-bit longs. 395*0Sstevel@tonic-gateStarting with 5.005, the beginnings of experimental support for systems 396*0Sstevel@tonic-gatewith 32-bit long and 64-bit 'long long' integers has been added. 397*0Sstevel@tonic-gateIf you add -DUSE_LONG_LONG to your ccflags in config.sh (or manually 398*0Sstevel@tonic-gatedefine it in perl.h) then perl will be built with 'long long' support. 399*0Sstevel@tonic-gateThere will be many compiler warnings, and the resultant perl may not 400*0Sstevel@tonic-gatework on all systems. There are many other issues related to 401*0Sstevel@tonic-gatethird-party extensions and libraries. This option exists to allow 402*0Sstevel@tonic-gatepeople to work on those issues. 403*0Sstevel@tonic-gate 404*0Sstevel@tonic-gate=head2 prototype() returns useful results on builtins 405*0Sstevel@tonic-gate 406*0Sstevel@tonic-gateSee L<perlfunc/prototype>. 407*0Sstevel@tonic-gate 408*0Sstevel@tonic-gate=head2 Extended support for exception handling 409*0Sstevel@tonic-gate 410*0Sstevel@tonic-gateC<die()> now accepts a reference value, and C<$@> gets set to that 411*0Sstevel@tonic-gatevalue in exception traps. This makes it possible to propagate 412*0Sstevel@tonic-gateexception objects. This is an undocumented B<experimental> feature. 413*0Sstevel@tonic-gate 414*0Sstevel@tonic-gate=head2 Re-blessing in DESTROY() supported for chaining DESTROY() methods 415*0Sstevel@tonic-gate 416*0Sstevel@tonic-gateSee L<perlobj/Destructors>. 417*0Sstevel@tonic-gate 418*0Sstevel@tonic-gate=head2 All C<printf> format conversions are handled internally 419*0Sstevel@tonic-gate 420*0Sstevel@tonic-gateSee L<perlfunc/printf>. 421*0Sstevel@tonic-gate 422*0Sstevel@tonic-gate=head2 New C<INIT> keyword 423*0Sstevel@tonic-gate 424*0Sstevel@tonic-gateC<INIT> subs are like C<BEGIN> and C<END>, but they get run just before 425*0Sstevel@tonic-gatethe perl runtime begins execution. e.g., the Perl Compiler makes use of 426*0Sstevel@tonic-gateC<INIT> blocks to initialize and resolve pointers to XSUBs. 427*0Sstevel@tonic-gate 428*0Sstevel@tonic-gate=head2 New C<lock> keyword 429*0Sstevel@tonic-gate 430*0Sstevel@tonic-gateThe C<lock> keyword is the fundamental synchronization primitive 431*0Sstevel@tonic-gatein threaded perl. When threads are not enabled, it is currently a noop. 432*0Sstevel@tonic-gate 433*0Sstevel@tonic-gateTo minimize impact on source compatibility this keyword is "weak", i.e., any 434*0Sstevel@tonic-gateuser-defined subroutine of the same name overrides it, unless a C<use Thread> 435*0Sstevel@tonic-gatehas been seen. 436*0Sstevel@tonic-gate 437*0Sstevel@tonic-gate=head2 New C<qr//> operator 438*0Sstevel@tonic-gate 439*0Sstevel@tonic-gateThe C<qr//> operator, which is syntactically similar to the other quote-like 440*0Sstevel@tonic-gateoperators, is used to create precompiled regular expressions. This compiled 441*0Sstevel@tonic-gateform can now be explicitly passed around in variables, and interpolated in 442*0Sstevel@tonic-gateother regular expressions. See L<perlop>. 443*0Sstevel@tonic-gate 444*0Sstevel@tonic-gate=head2 C<our> is now a reserved word 445*0Sstevel@tonic-gate 446*0Sstevel@tonic-gateCalling a subroutine with the name C<our> will now provoke a warning when 447*0Sstevel@tonic-gateusing the C<-w> switch. 448*0Sstevel@tonic-gate 449*0Sstevel@tonic-gate=head2 Tied arrays are now fully supported 450*0Sstevel@tonic-gate 451*0Sstevel@tonic-gateSee L<Tie::Array>. 452*0Sstevel@tonic-gate 453*0Sstevel@tonic-gate=head2 Tied handles support is better 454*0Sstevel@tonic-gate 455*0Sstevel@tonic-gateSeveral missing hooks have been added. There is also a new base class for 456*0Sstevel@tonic-gateTIEARRAY implementations. See L<Tie::Array>. 457*0Sstevel@tonic-gate 458*0Sstevel@tonic-gate=head2 4th argument to substr 459*0Sstevel@tonic-gate 460*0Sstevel@tonic-gatesubstr() can now both return and replace in one operation. The optional 461*0Sstevel@tonic-gate4th argument is the replacement string. See L<perlfunc/substr>. 462*0Sstevel@tonic-gate 463*0Sstevel@tonic-gate=head2 Negative LENGTH argument to splice 464*0Sstevel@tonic-gate 465*0Sstevel@tonic-gatesplice() with a negative LENGTH argument now work similar to what the 466*0Sstevel@tonic-gateLENGTH did for substr(). Previously a negative LENGTH was treated as 467*0Sstevel@tonic-gate0. See L<perlfunc/splice>. 468*0Sstevel@tonic-gate 469*0Sstevel@tonic-gate=head2 Magic lvalues are now more magical 470*0Sstevel@tonic-gate 471*0Sstevel@tonic-gateWhen you say something like C<substr($x, 5) = "hi">, the scalar returned 472*0Sstevel@tonic-gateby substr() is special, in that any modifications to it affect $x. 473*0Sstevel@tonic-gate(This is called a 'magic lvalue' because an 'lvalue' is something on 474*0Sstevel@tonic-gatethe left side of an assignment.) Normally, this is exactly what you 475*0Sstevel@tonic-gatewould expect to happen, but Perl uses the same magic if you use substr(), 476*0Sstevel@tonic-gatepos(), or vec() in a context where they might be modified, like taking 477*0Sstevel@tonic-gatea reference with C<\> or as an argument to a sub that modifies C<@_>. 478*0Sstevel@tonic-gateIn previous versions, this 'magic' only went one way, but now changes 479*0Sstevel@tonic-gateto the scalar the magic refers to ($x in the above example) affect the 480*0Sstevel@tonic-gatemagic lvalue too. For instance, this code now acts differently: 481*0Sstevel@tonic-gate 482*0Sstevel@tonic-gate $x = "hello"; 483*0Sstevel@tonic-gate sub printit { 484*0Sstevel@tonic-gate $x = "g'bye"; 485*0Sstevel@tonic-gate print $_[0], "\n"; 486*0Sstevel@tonic-gate } 487*0Sstevel@tonic-gate printit(substr($x, 0, 5)); 488*0Sstevel@tonic-gate 489*0Sstevel@tonic-gateIn previous versions, this would print "hello", but it now prints "g'bye". 490*0Sstevel@tonic-gate 491*0Sstevel@tonic-gate=head2 <> now reads in records 492*0Sstevel@tonic-gate 493*0Sstevel@tonic-gateIf C<$/> is a reference to an integer, or a scalar that holds an integer, 494*0Sstevel@tonic-gate<> will read in records instead of lines. For more info, see 495*0Sstevel@tonic-gateL<perlvar/$E<sol>>. 496*0Sstevel@tonic-gate 497*0Sstevel@tonic-gate=head1 Supported Platforms 498*0Sstevel@tonic-gate 499*0Sstevel@tonic-gateConfigure has many incremental improvements. Site-wide policy for building 500*0Sstevel@tonic-gateperl can now be made persistent, via Policy.sh. Configure also records 501*0Sstevel@tonic-gatethe command-line arguments used in F<config.sh>. 502*0Sstevel@tonic-gate 503*0Sstevel@tonic-gate=head2 New Platforms 504*0Sstevel@tonic-gate 505*0Sstevel@tonic-gateBeOS is now supported. See F<README.beos>. 506*0Sstevel@tonic-gate 507*0Sstevel@tonic-gateDOS is now supported under the DJGPP tools. See F<README.dos> (installed 508*0Sstevel@tonic-gateas L<perldos> on some systems). 509*0Sstevel@tonic-gate 510*0Sstevel@tonic-gateMiNT is now supported. See F<README.mint>. 511*0Sstevel@tonic-gate 512*0Sstevel@tonic-gateMPE/iX is now supported. See F<README.mpeix>. 513*0Sstevel@tonic-gate 514*0Sstevel@tonic-gateMVS (aka OS390, aka Open Edition) is now supported. See F<README.os390> 515*0Sstevel@tonic-gate(installed as L<perlos390> on some systems). 516*0Sstevel@tonic-gate 517*0Sstevel@tonic-gateStratus VOS is now supported. See F<README.vos>. 518*0Sstevel@tonic-gate 519*0Sstevel@tonic-gate=head2 Changes in existing support 520*0Sstevel@tonic-gate 521*0Sstevel@tonic-gateWin32 support has been vastly enhanced. Support for Perl Object, a C++ 522*0Sstevel@tonic-gateencapsulation of Perl. GCC and EGCS are now supported on Win32. 523*0Sstevel@tonic-gateSee F<README.win32>, aka L<perlwin32>. 524*0Sstevel@tonic-gate 525*0Sstevel@tonic-gateVMS configuration system has been rewritten. See F<README.vms> (installed 526*0Sstevel@tonic-gateas L<README_vms> on some systems). 527*0Sstevel@tonic-gate 528*0Sstevel@tonic-gateThe hints files for most Unix platforms have seen incremental improvements. 529*0Sstevel@tonic-gate 530*0Sstevel@tonic-gate=head1 Modules and Pragmata 531*0Sstevel@tonic-gate 532*0Sstevel@tonic-gate=head2 New Modules 533*0Sstevel@tonic-gate 534*0Sstevel@tonic-gate=over 4 535*0Sstevel@tonic-gate 536*0Sstevel@tonic-gate=item B 537*0Sstevel@tonic-gate 538*0Sstevel@tonic-gatePerl compiler and tools. See L<B>. 539*0Sstevel@tonic-gate 540*0Sstevel@tonic-gate=item Data::Dumper 541*0Sstevel@tonic-gate 542*0Sstevel@tonic-gateA module to pretty print Perl data. See L<Data::Dumper>. 543*0Sstevel@tonic-gate 544*0Sstevel@tonic-gate=item Dumpvalue 545*0Sstevel@tonic-gate 546*0Sstevel@tonic-gateA module to dump perl values to the screen. See L<Dumpvalue>. 547*0Sstevel@tonic-gate 548*0Sstevel@tonic-gate=item Errno 549*0Sstevel@tonic-gate 550*0Sstevel@tonic-gateA module to look up errors more conveniently. See L<Errno>. 551*0Sstevel@tonic-gate 552*0Sstevel@tonic-gate=item File::Spec 553*0Sstevel@tonic-gate 554*0Sstevel@tonic-gateA portable API for file operations. 555*0Sstevel@tonic-gate 556*0Sstevel@tonic-gate=item ExtUtils::Installed 557*0Sstevel@tonic-gate 558*0Sstevel@tonic-gateQuery and manage installed modules. 559*0Sstevel@tonic-gate 560*0Sstevel@tonic-gate=item ExtUtils::Packlist 561*0Sstevel@tonic-gate 562*0Sstevel@tonic-gateManipulate .packlist files. 563*0Sstevel@tonic-gate 564*0Sstevel@tonic-gate=item Fatal 565*0Sstevel@tonic-gate 566*0Sstevel@tonic-gateMake functions/builtins succeed or die. 567*0Sstevel@tonic-gate 568*0Sstevel@tonic-gate=item IPC::SysV 569*0Sstevel@tonic-gate 570*0Sstevel@tonic-gateConstants and other support infrastructure for System V IPC operations 571*0Sstevel@tonic-gatein perl. 572*0Sstevel@tonic-gate 573*0Sstevel@tonic-gate=item Test 574*0Sstevel@tonic-gate 575*0Sstevel@tonic-gateA framework for writing testsuites. 576*0Sstevel@tonic-gate 577*0Sstevel@tonic-gate=item Tie::Array 578*0Sstevel@tonic-gate 579*0Sstevel@tonic-gateBase class for tied arrays. 580*0Sstevel@tonic-gate 581*0Sstevel@tonic-gate=item Tie::Handle 582*0Sstevel@tonic-gate 583*0Sstevel@tonic-gateBase class for tied handles. 584*0Sstevel@tonic-gate 585*0Sstevel@tonic-gate=item Thread 586*0Sstevel@tonic-gate 587*0Sstevel@tonic-gatePerl thread creation, manipulation, and support. 588*0Sstevel@tonic-gate 589*0Sstevel@tonic-gate=item attrs 590*0Sstevel@tonic-gate 591*0Sstevel@tonic-gateSet subroutine attributes. 592*0Sstevel@tonic-gate 593*0Sstevel@tonic-gate=item fields 594*0Sstevel@tonic-gate 595*0Sstevel@tonic-gateCompile-time class fields. 596*0Sstevel@tonic-gate 597*0Sstevel@tonic-gate=item re 598*0Sstevel@tonic-gate 599*0Sstevel@tonic-gateVarious pragmata to control behavior of regular expressions. 600*0Sstevel@tonic-gate 601*0Sstevel@tonic-gate=back 602*0Sstevel@tonic-gate 603*0Sstevel@tonic-gate=head2 Changes in existing modules 604*0Sstevel@tonic-gate 605*0Sstevel@tonic-gate=over 4 606*0Sstevel@tonic-gate 607*0Sstevel@tonic-gate=item Benchmark 608*0Sstevel@tonic-gate 609*0Sstevel@tonic-gateYou can now run tests for I<x> seconds instead of guessing the right 610*0Sstevel@tonic-gatenumber of tests to run. 611*0Sstevel@tonic-gate 612*0Sstevel@tonic-gateKeeps better time. 613*0Sstevel@tonic-gate 614*0Sstevel@tonic-gate=item Carp 615*0Sstevel@tonic-gate 616*0Sstevel@tonic-gateCarp has a new function cluck(). cluck() warns, like carp(), but also adds 617*0Sstevel@tonic-gatea stack backtrace to the error message, like confess(). 618*0Sstevel@tonic-gate 619*0Sstevel@tonic-gate=item CGI 620*0Sstevel@tonic-gate 621*0Sstevel@tonic-gateCGI has been updated to version 2.42. 622*0Sstevel@tonic-gate 623*0Sstevel@tonic-gate=item Fcntl 624*0Sstevel@tonic-gate 625*0Sstevel@tonic-gateMore Fcntl constants added: F_SETLK64, F_SETLKW64, O_LARGEFILE for 626*0Sstevel@tonic-gatelarge (more than 4G) file access (the 64-bit support is not yet 627*0Sstevel@tonic-gateworking, though, so no need to get overly excited), Free/Net/OpenBSD 628*0Sstevel@tonic-gatelocking behaviour flags F_FLOCK, F_POSIX, Linux F_SHLCK, and 629*0Sstevel@tonic-gateO_ACCMODE: the mask of O_RDONLY, O_WRONLY, and O_RDWR. 630*0Sstevel@tonic-gate 631*0Sstevel@tonic-gate=item Math::Complex 632*0Sstevel@tonic-gate 633*0Sstevel@tonic-gateThe accessors methods Re, Im, arg, abs, rho, theta, methods can 634*0Sstevel@tonic-gate($z->Re()) now also act as mutators ($z->Re(3)). 635*0Sstevel@tonic-gate 636*0Sstevel@tonic-gate=item Math::Trig 637*0Sstevel@tonic-gate 638*0Sstevel@tonic-gateA little bit of radial trigonometry (cylindrical and spherical) added, 639*0Sstevel@tonic-gatefor example the great circle distance. 640*0Sstevel@tonic-gate 641*0Sstevel@tonic-gate=item POSIX 642*0Sstevel@tonic-gate 643*0Sstevel@tonic-gatePOSIX now has its own platform-specific hints files. 644*0Sstevel@tonic-gate 645*0Sstevel@tonic-gate=item DB_File 646*0Sstevel@tonic-gate 647*0Sstevel@tonic-gateDB_File supports version 2.x of Berkeley DB. See C<ext/DB_File/Changes>. 648*0Sstevel@tonic-gate 649*0Sstevel@tonic-gate=item MakeMaker 650*0Sstevel@tonic-gate 651*0Sstevel@tonic-gateMakeMaker now supports writing empty makefiles, provides a way to 652*0Sstevel@tonic-gatespecify that site umask() policy should be honored. There is also 653*0Sstevel@tonic-gatebetter support for manipulation of .packlist files, and getting 654*0Sstevel@tonic-gateinformation about installed modules. 655*0Sstevel@tonic-gate 656*0Sstevel@tonic-gateExtensions that have both architecture-dependent and 657*0Sstevel@tonic-gatearchitecture-independent files are now always installed completely in 658*0Sstevel@tonic-gatethe architecture-dependent locations. Previously, the shareable parts 659*0Sstevel@tonic-gatewere shared both across architectures and across perl versions and were 660*0Sstevel@tonic-gatetherefore liable to be overwritten with newer versions that might have 661*0Sstevel@tonic-gatesubtle incompatibilities. 662*0Sstevel@tonic-gate 663*0Sstevel@tonic-gate=item CPAN 664*0Sstevel@tonic-gate 665*0Sstevel@tonic-gateSee L<perlmodinstall> and L<CPAN>. 666*0Sstevel@tonic-gate 667*0Sstevel@tonic-gate=item Cwd 668*0Sstevel@tonic-gate 669*0Sstevel@tonic-gateCwd::cwd is faster on most platforms. 670*0Sstevel@tonic-gate 671*0Sstevel@tonic-gate=back 672*0Sstevel@tonic-gate 673*0Sstevel@tonic-gate=head1 Utility Changes 674*0Sstevel@tonic-gate 675*0Sstevel@tonic-gateC<h2ph> and related utilities have been vastly overhauled. 676*0Sstevel@tonic-gate 677*0Sstevel@tonic-gateC<perlcc>, a new experimental front end for the compiler is available. 678*0Sstevel@tonic-gate 679*0Sstevel@tonic-gateThe crude GNU C<configure> emulator is now called C<configure.gnu> to 680*0Sstevel@tonic-gateavoid trampling on C<Configure> under case-insensitive filesystems. 681*0Sstevel@tonic-gate 682*0Sstevel@tonic-gateC<perldoc> used to be rather slow. The slower features are now optional. 683*0Sstevel@tonic-gateIn particular, case-insensitive searches need the C<-i> switch, and 684*0Sstevel@tonic-gaterecursive searches need C<-r>. You can set these switches in the 685*0Sstevel@tonic-gateC<PERLDOC> environment variable to get the old behavior. 686*0Sstevel@tonic-gate 687*0Sstevel@tonic-gate=head1 Documentation Changes 688*0Sstevel@tonic-gate 689*0Sstevel@tonic-gateConfig.pm now has a glossary of variables. 690*0Sstevel@tonic-gate 691*0Sstevel@tonic-gateF<Porting/patching.pod> has detailed instructions on how to create and 692*0Sstevel@tonic-gatesubmit patches for perl. 693*0Sstevel@tonic-gate 694*0Sstevel@tonic-gateL<perlport> specifies guidelines on how to write portably. 695*0Sstevel@tonic-gate 696*0Sstevel@tonic-gateL<perlmodinstall> describes how to fetch and install modules from C<CPAN> 697*0Sstevel@tonic-gatesites. 698*0Sstevel@tonic-gate 699*0Sstevel@tonic-gateSome more Perl traps are documented now. See L<perltrap>. 700*0Sstevel@tonic-gate 701*0Sstevel@tonic-gateL<perlopentut> gives a tutorial on using open(). 702*0Sstevel@tonic-gate 703*0Sstevel@tonic-gateL<perlreftut> gives a tutorial on references. 704*0Sstevel@tonic-gate 705*0Sstevel@tonic-gateL<perlthrtut> gives a tutorial on threads. 706*0Sstevel@tonic-gate 707*0Sstevel@tonic-gate=head1 New Diagnostics 708*0Sstevel@tonic-gate 709*0Sstevel@tonic-gate=over 4 710*0Sstevel@tonic-gate 711*0Sstevel@tonic-gate=item Ambiguous call resolved as CORE::%s(), qualify as such or use & 712*0Sstevel@tonic-gate 713*0Sstevel@tonic-gate(W) A subroutine you have declared has the same name as a Perl keyword, 714*0Sstevel@tonic-gateand you have used the name without qualification for calling one or the 715*0Sstevel@tonic-gateother. Perl decided to call the builtin because the subroutine is 716*0Sstevel@tonic-gatenot imported. 717*0Sstevel@tonic-gate 718*0Sstevel@tonic-gateTo force interpretation as a subroutine call, either put an ampersand 719*0Sstevel@tonic-gatebefore the subroutine name, or qualify the name with its package. 720*0Sstevel@tonic-gateAlternatively, you can import the subroutine (or pretend that it's 721*0Sstevel@tonic-gateimported with the C<use subs> pragma). 722*0Sstevel@tonic-gate 723*0Sstevel@tonic-gateTo silently interpret it as the Perl operator, use the C<CORE::> prefix 724*0Sstevel@tonic-gateon the operator (e.g. C<CORE::log($x)>) or by declaring the subroutine 725*0Sstevel@tonic-gateto be an object method (see L<attrs>). 726*0Sstevel@tonic-gate 727*0Sstevel@tonic-gate=item Bad index while coercing array into hash 728*0Sstevel@tonic-gate 729*0Sstevel@tonic-gate(F) The index looked up in the hash found as the 0'th element of a 730*0Sstevel@tonic-gatepseudo-hash is not legal. Index values must be at 1 or greater. 731*0Sstevel@tonic-gateSee L<perlref>. 732*0Sstevel@tonic-gate 733*0Sstevel@tonic-gate=item Bareword "%s" refers to nonexistent package 734*0Sstevel@tonic-gate 735*0Sstevel@tonic-gate(W) You used a qualified bareword of the form C<Foo::>, but 736*0Sstevel@tonic-gatethe compiler saw no other uses of that namespace before that point. 737*0Sstevel@tonic-gatePerhaps you need to predeclare a package? 738*0Sstevel@tonic-gate 739*0Sstevel@tonic-gate=item Can't call method "%s" on an undefined value 740*0Sstevel@tonic-gate 741*0Sstevel@tonic-gate(F) You used the syntax of a method call, but the slot filled by the 742*0Sstevel@tonic-gateobject reference or package name contains an undefined value. 743*0Sstevel@tonic-gateSomething like this will reproduce the error: 744*0Sstevel@tonic-gate 745*0Sstevel@tonic-gate $BADREF = 42; 746*0Sstevel@tonic-gate process $BADREF 1,2,3; 747*0Sstevel@tonic-gate $BADREF->process(1,2,3); 748*0Sstevel@tonic-gate 749*0Sstevel@tonic-gate=item Can't check filesystem of script "%s" for nosuid 750*0Sstevel@tonic-gate 751*0Sstevel@tonic-gate(P) For some reason you can't check the filesystem of the script for nosuid. 752*0Sstevel@tonic-gate 753*0Sstevel@tonic-gate=item Can't coerce array into hash 754*0Sstevel@tonic-gate 755*0Sstevel@tonic-gate(F) You used an array where a hash was expected, but the array has no 756*0Sstevel@tonic-gateinformation on how to map from keys to array indices. You can do that 757*0Sstevel@tonic-gateonly with arrays that have a hash reference at index 0. 758*0Sstevel@tonic-gate 759*0Sstevel@tonic-gate=item Can't goto subroutine from an eval-string 760*0Sstevel@tonic-gate 761*0Sstevel@tonic-gate(F) The "goto subroutine" call can't be used to jump out of an eval "string". 762*0Sstevel@tonic-gate(You can use it to jump out of an eval {BLOCK}, but you probably don't want to.) 763*0Sstevel@tonic-gate 764*0Sstevel@tonic-gate=item Can't localize pseudo-hash element 765*0Sstevel@tonic-gate 766*0Sstevel@tonic-gate(F) You said something like C<< local $ar->{'key'} >>, where $ar is 767*0Sstevel@tonic-gatea reference to a pseudo-hash. That hasn't been implemented yet, but 768*0Sstevel@tonic-gateyou can get a similar effect by localizing the corresponding array 769*0Sstevel@tonic-gateelement directly -- C<< local $ar->[$ar->[0]{'key'}] >>. 770*0Sstevel@tonic-gate 771*0Sstevel@tonic-gate=item Can't use %%! because Errno.pm is not available 772*0Sstevel@tonic-gate 773*0Sstevel@tonic-gate(F) The first time the %! hash is used, perl automatically loads the 774*0Sstevel@tonic-gateErrno.pm module. The Errno module is expected to tie the %! hash to 775*0Sstevel@tonic-gateprovide symbolic names for C<$!> errno values. 776*0Sstevel@tonic-gate 777*0Sstevel@tonic-gate=item Cannot find an opnumber for "%s" 778*0Sstevel@tonic-gate 779*0Sstevel@tonic-gate(F) A string of a form C<CORE::word> was given to prototype(), but 780*0Sstevel@tonic-gatethere is no builtin with the name C<word>. 781*0Sstevel@tonic-gate 782*0Sstevel@tonic-gate=item Character class syntax [. .] is reserved for future extensions 783*0Sstevel@tonic-gate 784*0Sstevel@tonic-gate(W) Within regular expression character classes ([]) the syntax beginning 785*0Sstevel@tonic-gatewith "[." and ending with ".]" is reserved for future extensions. 786*0Sstevel@tonic-gateIf you need to represent those character sequences inside a regular 787*0Sstevel@tonic-gateexpression character class, just quote the square brackets with the 788*0Sstevel@tonic-gatebackslash: "\[." and ".\]". 789*0Sstevel@tonic-gate 790*0Sstevel@tonic-gate=item Character class syntax [: :] is reserved for future extensions 791*0Sstevel@tonic-gate 792*0Sstevel@tonic-gate(W) Within regular expression character classes ([]) the syntax beginning 793*0Sstevel@tonic-gatewith "[:" and ending with ":]" is reserved for future extensions. 794*0Sstevel@tonic-gateIf you need to represent those character sequences inside a regular 795*0Sstevel@tonic-gateexpression character class, just quote the square brackets with the 796*0Sstevel@tonic-gatebackslash: "\[:" and ":\]". 797*0Sstevel@tonic-gate 798*0Sstevel@tonic-gate=item Character class syntax [= =] is reserved for future extensions 799*0Sstevel@tonic-gate 800*0Sstevel@tonic-gate(W) Within regular expression character classes ([]) the syntax 801*0Sstevel@tonic-gatebeginning with "[=" and ending with "=]" is reserved for future extensions. 802*0Sstevel@tonic-gateIf you need to represent those character sequences inside a regular 803*0Sstevel@tonic-gateexpression character class, just quote the square brackets with the 804*0Sstevel@tonic-gatebackslash: "\[=" and "=\]". 805*0Sstevel@tonic-gate 806*0Sstevel@tonic-gate=item %s: Eval-group in insecure regular expression 807*0Sstevel@tonic-gate 808*0Sstevel@tonic-gate(F) Perl detected tainted data when trying to compile a regular expression 809*0Sstevel@tonic-gatethat contains the C<(?{ ... })> zero-width assertion, which is unsafe. 810*0Sstevel@tonic-gateSee L<perlre/(?{ code })>, and L<perlsec>. 811*0Sstevel@tonic-gate 812*0Sstevel@tonic-gate=item %s: Eval-group not allowed, use re 'eval' 813*0Sstevel@tonic-gate 814*0Sstevel@tonic-gate(F) A regular expression contained the C<(?{ ... })> zero-width assertion, 815*0Sstevel@tonic-gatebut that construct is only allowed when the C<use re 'eval'> pragma is 816*0Sstevel@tonic-gatein effect. See L<perlre/(?{ code })>. 817*0Sstevel@tonic-gate 818*0Sstevel@tonic-gate=item %s: Eval-group not allowed at run time 819*0Sstevel@tonic-gate 820*0Sstevel@tonic-gate(F) Perl tried to compile a regular expression containing the C<(?{ ... })> 821*0Sstevel@tonic-gatezero-width assertion at run time, as it would when the pattern contains 822*0Sstevel@tonic-gateinterpolated values. Since that is a security risk, it is not allowed. 823*0Sstevel@tonic-gateIf you insist, you may still do this by explicitly building the pattern 824*0Sstevel@tonic-gatefrom an interpolated string at run time and using that in an eval(). 825*0Sstevel@tonic-gateSee L<perlre/(?{ code })>. 826*0Sstevel@tonic-gate 827*0Sstevel@tonic-gate=item Explicit blessing to '' (assuming package main) 828*0Sstevel@tonic-gate 829*0Sstevel@tonic-gate(W) You are blessing a reference to a zero length string. This has 830*0Sstevel@tonic-gatethe effect of blessing the reference into the package main. This is 831*0Sstevel@tonic-gateusually not what you want. Consider providing a default target 832*0Sstevel@tonic-gatepackage, e.g. bless($ref, $p || 'MyPackage'); 833*0Sstevel@tonic-gate 834*0Sstevel@tonic-gate=item Illegal hex digit ignored 835*0Sstevel@tonic-gate 836*0Sstevel@tonic-gate(W) You may have tried to use a character other than 0 - 9 or A - F in a 837*0Sstevel@tonic-gatehexadecimal number. Interpretation of the hexadecimal number stopped 838*0Sstevel@tonic-gatebefore the illegal character. 839*0Sstevel@tonic-gate 840*0Sstevel@tonic-gate=item No such array field 841*0Sstevel@tonic-gate 842*0Sstevel@tonic-gate(F) You tried to access an array as a hash, but the field name used is 843*0Sstevel@tonic-gatenot defined. The hash at index 0 should map all valid field names to 844*0Sstevel@tonic-gatearray indices for that to work. 845*0Sstevel@tonic-gate 846*0Sstevel@tonic-gate=item No such field "%s" in variable %s of type %s 847*0Sstevel@tonic-gate 848*0Sstevel@tonic-gate(F) You tried to access a field of a typed variable where the type 849*0Sstevel@tonic-gatedoes not know about the field name. The field names are looked up in 850*0Sstevel@tonic-gatethe %FIELDS hash in the type package at compile time. The %FIELDS hash 851*0Sstevel@tonic-gateis usually set up with the 'fields' pragma. 852*0Sstevel@tonic-gate 853*0Sstevel@tonic-gate=item Out of memory during ridiculously large request 854*0Sstevel@tonic-gate 855*0Sstevel@tonic-gate(F) You can't allocate more than 2^31+"small amount" bytes. This error 856*0Sstevel@tonic-gateis most likely to be caused by a typo in the Perl program. e.g., C<$arr[time]> 857*0Sstevel@tonic-gateinstead of C<$arr[$time]>. 858*0Sstevel@tonic-gate 859*0Sstevel@tonic-gate=item Range iterator outside integer range 860*0Sstevel@tonic-gate 861*0Sstevel@tonic-gate(F) One (or both) of the numeric arguments to the range operator ".." 862*0Sstevel@tonic-gateare outside the range which can be represented by integers internally. 863*0Sstevel@tonic-gateOne possible workaround is to force Perl to use magical string 864*0Sstevel@tonic-gateincrement by prepending "0" to your numbers. 865*0Sstevel@tonic-gate 866*0Sstevel@tonic-gate=item Recursive inheritance detected while looking for method '%s' %s 867*0Sstevel@tonic-gate 868*0Sstevel@tonic-gate(F) More than 100 levels of inheritance were encountered while invoking a 869*0Sstevel@tonic-gatemethod. Probably indicates an unintended loop in your inheritance hierarchy. 870*0Sstevel@tonic-gate 871*0Sstevel@tonic-gate=item Reference found where even-sized list expected 872*0Sstevel@tonic-gate 873*0Sstevel@tonic-gate(W) You gave a single reference where Perl was expecting a list with 874*0Sstevel@tonic-gatean even number of elements (for assignment to a hash). This 875*0Sstevel@tonic-gateusually means that you used the anon hash constructor when you meant 876*0Sstevel@tonic-gateto use parens. In any case, a hash requires key/value B<pairs>. 877*0Sstevel@tonic-gate 878*0Sstevel@tonic-gate %hash = { one => 1, two => 2, }; # WRONG 879*0Sstevel@tonic-gate %hash = [ qw/ an anon array / ]; # WRONG 880*0Sstevel@tonic-gate %hash = ( one => 1, two => 2, ); # right 881*0Sstevel@tonic-gate %hash = qw( one 1 two 2 ); # also fine 882*0Sstevel@tonic-gate 883*0Sstevel@tonic-gate=item Undefined value assigned to typeglob 884*0Sstevel@tonic-gate 885*0Sstevel@tonic-gate(W) An undefined value was assigned to a typeglob, a la C<*foo = undef>. 886*0Sstevel@tonic-gateThis does nothing. It's possible that you really mean C<undef *foo>. 887*0Sstevel@tonic-gate 888*0Sstevel@tonic-gate=item Use of reserved word "%s" is deprecated 889*0Sstevel@tonic-gate 890*0Sstevel@tonic-gate(D) The indicated bareword is a reserved word. Future versions of perl 891*0Sstevel@tonic-gatemay use it as a keyword, so you're better off either explicitly quoting 892*0Sstevel@tonic-gatethe word in a manner appropriate for its context of use, or using a 893*0Sstevel@tonic-gatedifferent name altogether. The warning can be suppressed for subroutine 894*0Sstevel@tonic-gatenames by either adding a C<&> prefix, or using a package qualifier, 895*0Sstevel@tonic-gatee.g. C<&our()>, or C<Foo::our()>. 896*0Sstevel@tonic-gate 897*0Sstevel@tonic-gate=item perl: warning: Setting locale failed. 898*0Sstevel@tonic-gate 899*0Sstevel@tonic-gate(S) The whole warning message will look something like: 900*0Sstevel@tonic-gate 901*0Sstevel@tonic-gate perl: warning: Setting locale failed. 902*0Sstevel@tonic-gate perl: warning: Please check that your locale settings: 903*0Sstevel@tonic-gate LC_ALL = "En_US", 904*0Sstevel@tonic-gate LANG = (unset) 905*0Sstevel@tonic-gate are supported and installed on your system. 906*0Sstevel@tonic-gate perl: warning: Falling back to the standard locale ("C"). 907*0Sstevel@tonic-gate 908*0Sstevel@tonic-gateExactly what were the failed locale settings varies. In the above the 909*0Sstevel@tonic-gatesettings were that the LC_ALL was "En_US" and the LANG had no value. 910*0Sstevel@tonic-gateThis error means that Perl detected that you and/or your system 911*0Sstevel@tonic-gateadministrator have set up the so-called variable system but Perl could 912*0Sstevel@tonic-gatenot use those settings. This was not dead serious, fortunately: there 913*0Sstevel@tonic-gateis a "default locale" called "C" that Perl can and will use, the 914*0Sstevel@tonic-gatescript will be run. Before you really fix the problem, however, you 915*0Sstevel@tonic-gatewill get the same error message each time you run Perl. How to really 916*0Sstevel@tonic-gatefix the problem can be found in L<perllocale/"LOCALE PROBLEMS">. 917*0Sstevel@tonic-gate 918*0Sstevel@tonic-gate=back 919*0Sstevel@tonic-gate 920*0Sstevel@tonic-gate 921*0Sstevel@tonic-gate=head1 Obsolete Diagnostics 922*0Sstevel@tonic-gate 923*0Sstevel@tonic-gate=over 4 924*0Sstevel@tonic-gate 925*0Sstevel@tonic-gate=item Can't mktemp() 926*0Sstevel@tonic-gate 927*0Sstevel@tonic-gate(F) The mktemp() routine failed for some reason while trying to process 928*0Sstevel@tonic-gatea B<-e> switch. Maybe your /tmp partition is full, or clobbered. 929*0Sstevel@tonic-gate 930*0Sstevel@tonic-gateRemoved because B<-e> doesn't use temporary files any more. 931*0Sstevel@tonic-gate 932*0Sstevel@tonic-gate=item Can't write to temp file for B<-e>: %s 933*0Sstevel@tonic-gate 934*0Sstevel@tonic-gate(F) The write routine failed for some reason while trying to process 935*0Sstevel@tonic-gatea B<-e> switch. Maybe your /tmp partition is full, or clobbered. 936*0Sstevel@tonic-gate 937*0Sstevel@tonic-gateRemoved because B<-e> doesn't use temporary files any more. 938*0Sstevel@tonic-gate 939*0Sstevel@tonic-gate=item Cannot open temporary file 940*0Sstevel@tonic-gate 941*0Sstevel@tonic-gate(F) The create routine failed for some reason while trying to process 942*0Sstevel@tonic-gatea B<-e> switch. Maybe your /tmp partition is full, or clobbered. 943*0Sstevel@tonic-gate 944*0Sstevel@tonic-gateRemoved because B<-e> doesn't use temporary files any more. 945*0Sstevel@tonic-gate 946*0Sstevel@tonic-gate=item regexp too big 947*0Sstevel@tonic-gate 948*0Sstevel@tonic-gate(F) The current implementation of regular expressions uses shorts as 949*0Sstevel@tonic-gateaddress offsets within a string. Unfortunately this means that if 950*0Sstevel@tonic-gatethe regular expression compiles to longer than 32767, it'll blow up. 951*0Sstevel@tonic-gateUsually when you want a regular expression this big, there is a better 952*0Sstevel@tonic-gateway to do it with multiple statements. See L<perlre>. 953*0Sstevel@tonic-gate 954*0Sstevel@tonic-gate=back 955*0Sstevel@tonic-gate 956*0Sstevel@tonic-gate=head1 Configuration Changes 957*0Sstevel@tonic-gate 958*0Sstevel@tonic-gateYou can use "Configure -Uinstallusrbinperl" which causes installperl 959*0Sstevel@tonic-gateto skip installing perl also as /usr/bin/perl. This is useful if you 960*0Sstevel@tonic-gateprefer not to modify /usr/bin for some reason or another but harmful 961*0Sstevel@tonic-gatebecause many scripts assume to find Perl in /usr/bin/perl. 962*0Sstevel@tonic-gate 963*0Sstevel@tonic-gate=head1 BUGS 964*0Sstevel@tonic-gate 965*0Sstevel@tonic-gateIf you find what you think is a bug, you might check the headers of 966*0Sstevel@tonic-gaterecently posted articles in the comp.lang.perl.misc newsgroup. 967*0Sstevel@tonic-gateThere may also be information at http://www.perl.com/perl/ , the Perl 968*0Sstevel@tonic-gateHome Page. 969*0Sstevel@tonic-gate 970*0Sstevel@tonic-gateIf you believe you have an unreported bug, please run the B<perlbug> 971*0Sstevel@tonic-gateprogram included with your release. Make sure you trim your bug down 972*0Sstevel@tonic-gateto a tiny but sufficient test case. Your bug report, along with the 973*0Sstevel@tonic-gateoutput of C<perl -V>, will be sent off to <F<perlbug@perl.com>> to be 974*0Sstevel@tonic-gateanalysed by the Perl porting team. 975*0Sstevel@tonic-gate 976*0Sstevel@tonic-gate=head1 SEE ALSO 977*0Sstevel@tonic-gate 978*0Sstevel@tonic-gateThe F<Changes> file for exhaustive details on what changed. 979*0Sstevel@tonic-gate 980*0Sstevel@tonic-gateThe F<INSTALL> file for how to build Perl. 981*0Sstevel@tonic-gate 982*0Sstevel@tonic-gateThe F<README> file for general stuff. 983*0Sstevel@tonic-gate 984*0Sstevel@tonic-gateThe F<Artistic> and F<Copying> files for copyright information. 985*0Sstevel@tonic-gate 986*0Sstevel@tonic-gate=head1 HISTORY 987*0Sstevel@tonic-gate 988*0Sstevel@tonic-gateWritten by Gurusamy Sarathy <F<gsar@activestate.com>>, with many contributions 989*0Sstevel@tonic-gatefrom The Perl Porters. 990*0Sstevel@tonic-gate 991*0Sstevel@tonic-gateSend omissions or corrections to <F<perlbug@perl.com>>. 992*0Sstevel@tonic-gate 993*0Sstevel@tonic-gate=cut 994