ANNOUNCE: 5.005_58 perldelta page 
Author Message
 ANNOUNCE: 5.005_58 perldelta page

See http://www.*-*-*.com/

NAME
    perldelta - what's new for perl v5.6 (as of v5.005_58)

DESCRIPTION
    This is an unsupported alpha release, meant for intrepid Perl
    developers only. The included sources may not even build
    correctly on some platforms. Subscribing to perl5-porters is the
    best way to monitor and contribute to the progress of
    development releases (see www.perl.org for info).

    This document describes differences between the 5.005 release
    and this one.

Incompatible Changes
  Perl Source Incompatibilities

    TODO

  C Source Incompatibilities

    `PERL_POLLUTE'
        Release 5.005 grandfathered old global symbol names by
        providing preprocessor macros for extension source
        compatibility. As of release 5.6, these preprocessor
        definitions are not available by default. You need to
        explicitly compile perl with `-DPERL_POLLUTE' to get these
        definitions. For extensions still using the old symbols,
        this option can be specified via MakeMaker:

            perl Makefile.PL POLLUTE=1

    `PERL_IMPLICIT_CONTEXT'
        This new build option provides a set of macros for all API
        functions such that an implicit interpreter/thread context
        argument is passed to every API function. As a result of
        this, something like `sv_setsv(foo,bar)' amounts to a macro
        invocation that actually translates to
        `Perl_sv_setsv(my_perl,foo,bar)'. While this is generally
        expected to not have any significant source compatibility
        issues, the difference between a macro and a real function
        call will need to be considered.

        Note that the above issue is not relevant to the default
        build of Perl, whose interfaces continue to match those of
        prior versions (but subject to the other options described
        here).

        For testing purposes, the 5.005_58 release automatically
        enables PERL_IMPLICIT_CONTEXT whenever Perl is built with -
        Dusethreads or -Dusemultiplicity.

    `PERL_POLLUTE_MALLOC'
        Enabling Perl's malloc in release 5.005 and earlier caused
        the namespace of system versions of the malloc family of
        functions to be usurped by the Perl versions, since by
        default they used the same names.

        Besides causing problems on platforms that do not allow
        these functions to be cleanly replaced, this also meant that
        the system versions could not be called in programs that
        used Perl's malloc. Previous versions of Perl have allowed
        this behaviour to be suppressed with the HIDEMYMALLOC and
        EMBEDMYMALLOC preprocessor definitions.

        As of release 5.6, Perl's malloc family of functions have
        default names distinct from the system versions. You need to
        explicitly compile perl with `-DPERL_POLLUTE_MALLOC' to get
        the older behaviour. HIDEMYMALLOC and EMBEDMYMALLOC have no
        effect, since the behaviour they enabled is now the default.

        Note that these functions do not constitute Perl's memory
        allocation API. See the section on "Memory Allocation" in
        the perlguts manpage for further information about that.

    `PL_na' and `dTHR' Issues
        The `PL_na' global is now thread local, so a `dTHR'
        declaration is needed in the scope in which the global
        appears. XSUBs should handle this automatically, but if you
        have used `PL_na' in support functions, you either need to
        change the `PL_na' to a local variable (which is
        recommended), or put in a `dTHR'.

  Compatible C Source API Changes

    `PATCHLEVEL' is now `PERL_VERSION'
        The cpp macros `PERL_REVISION', `PERL_VERSION', and
        `PERL_SUBVERSION' are now available by default from perl.h,
        and reflect the base revision, patchlevel, and subversion
        respectively. `PERL_REVISION' had no prior equivalent, while
        `PERL_VERSION' and `PERL_SUBVERSION' were previously
        available as `PATCHLEVEL' and `SUBVERSION'.

        The new names cause less pollution of the cpp namespace and
        reflect what the numbers have come to stand for in common
        practice. For compatibility, the old names are still
        supported when patchlevel.h is explicitly included (as
        required before), so there is no source incompatibility from
        the change.

  Binary Incompatibilities

    The default build of this release can be made binary compatible
    with the 5.005 release or its maintenance versions. Add -
    DPERL_BINCOMPAT_5005 to ccflags in config.sh to achieve this.
    See INSTALL for further information about adding build flags to
    config.sh.

    The usethreads or usemultiplicity builds are not binary
    compatible with the corresponding builds in 5.005.

Core Changes
  Unicode and UTF-8 support

    Perl can optionally use UTF-8 as its internal representation for
    character strings. The `use utf8' pragma enables this support in
    the current lexical scope. See the utf8 manpage for more
    information.

  Lexically scoped warning categories

    You can now control the granularity of warnings emitted by perl
    at a finer level using the `use warning' pragma. See the warning
    manpage and the perllexwarn manpage for details.

  Binary numbers supported

    Binary numbers are now supported as literals, in s?printf
    formats, and `oct()':

        $answer = 0b101010;
        printf "The answer is: %b\n", oct("0b101010");

  syswrite() ease-of-use

    The length argument of `syswrite()' is now optional.

  64-bit support

    Better 64-bit support -- but full support still a distant goal.
    One must Configure with -Duse64bits to get Configure to probe
    for the extent of 64-bit support. Depending on the platform
    (hints file) more or less 64-awareness becomes available. As of
    5.005_54 at least somewhat 64-bit aware platforms are HP-UX 11
    or better, Solaris 2.6 or better, IRIX 6.2 or better. Naturally
    64-bit platforms like Digital Unix and UNICOS also have 64-bit
    support.

  Better syntax checks on parenthesized unary operators

    Expressions such as:

        print defined(&foo,&bar,&baz);
        print uc("foo","bar","baz");
        undef($foo,&bar);

    used to be accidentally allowed in earlier versions, and
    produced unpredictable behaviour. Some produced ancillary
    warnings when used in this way; others silently did the wrong
    thing.

    The parenthesized forms of most unary operators that expect a
    single argument now ensure that they are not called with more
    than one argument, making the cases shown above syntax errors.
    The usual behaviour of:

        print defined &foo, &bar, &baz;
        print uc "foo", "bar", "baz";
        undef $foo, &bar;

    remains unchanged. See the perlop manpage.

  POSIX character class syntax [: :] supported

    For example to match alphabetic characters use /[[:alpha:]]/.
    See the perlre manpage for details.

  Improved `qw//' operator

    The `qw//' operator is now evaluated at compile time into a true
    list instead of being replaced with a run time call to
    `split()'. This removes the confusing misbehaviour of `qw//' in
    scalar context, which had inherited that behaviour from split().

    Thus:

        $foo = ($bar) = qw(a b c); print "$foo|$bar\n";

    now correctly prints "3|a", instead of "2|a".

  pack() format 'Z' supported

    The new format type 'Z' is useful for packing and unpacking
    null-terminated strings. See the section on "pack" in the
    perlfunc manpage.

  pack() format modifier '!' supported

    The new format type modifier '!' is useful for packing and
    unpacking native shorts, ints, and longs. See the section on
    "pack" in the perlfunc manpage.

  pack() and unpack() support counted strings

    The template character '#' can be used to specify a counted
    string type to be packed or unpacked. See the section on "pack"
    in the perlfunc manpage.

  $^X variables may now have names longer than one character

    Formerly, $^X was synonymous with ${"\cX"}, but $^XY was a
    syntax error. Now variable names that begin with a control
    character may be arbitrarily long. However, for compatibility
    reasons, these variables *must* be written with explicit braces,
    as `${^XY}' for example. `${^XYZ}' is synonymous with
    ${"\cXYZ"}. Variable names with more than one control character,
    such as `${^XY^Z}', are illegal.

    The old syntax has not changed. As before, `^X' may be either a
    literal control-X character or the two-character sequence
    `caret' plus `X'. When braces are omitted, the variable name
    stops after the control character. Thus `"$^XYZ"' continues to
    be synonymous with `$^X . "YZ"' as before.

    As before, lexical variables may not have names beginning with
    control characters. As before, variables whose names begin with
    a control character are always forced to be in package `main'.
    All such variables are reserved for future extensions, except
    those that begin with `^_', which may be used by user programs
    and is guaranteed not to acquire special meaning in any future
    version of Perl.

Significant bug fixes
  <HANDLE> on empty files

    With `$/' set to `undef', slurping an empty file returns a
    string of zero length (instead of `undef', as it used to) the
    first time the HANDLE is read. Further reads yield `undef'.

    This means that the following will append "foo" to an empty file
    (it used to do nothing):

        perl -0777 -pi -e 's/^/foo/' empty_file

    The behaviour of:

        perl -pi -e 's/^/foo/' empty_file

    is unchanged (it continues to leave the file empty).

  `eval '...'' improvements

    Line numbers (as reflected by caller() and most diagnostics)
    within `eval '...'' were often incorrect when here documents
    were involved.
...

read more »



Tue, 15 Jan 2002 03:00:00 GMT  
 ANNOUNCE: 5.005_58 perldelta page
what is the recommended c preprozessor conditional to switch between na
and PL_na resp. the old POLLUTEd and the new 5.006 names?

i want to keep the XSUBs for older perl version, but want to fix them
for 5.006.
for now i used this in all older xs module code

#ifdef PATCHLEVEL
  // old xs code with na, ...
#else
  // fixed to PL_na, localized it, added dTHR, ...
#endif

but patchlevel.h could be manually included (which would fail then) and
it is not so obvious. i couldn't find a meaningful POLLUTE definition
for a conditional.
#if ((PERL_SUBVERSION > 5) ||
     ((PERL_SUBVERSION == 5) && (PERL_REVISION >= 58)))

could also be used. but this is a bit too hard to recommend for every
XSUB writer.

i don't want to use perl Makefile.PL POLLUTE=1, because i want to fix
the xs code directly to adopt the new names.

--                                        
Reini



Fri, 18 Jan 2002 03:00:00 GMT  
 ANNOUNCE: 5.005_58 perldelta page
hmm, i have 187 modules here with approx. 50% using xsubs waiting to be
fixed. and i'm sure i'll have to do it by myself for 5.006.

so i asked for the recommended way to fix all these modules from
different authors without having to think of how to replace the global
"na" with a local one. and with keeping the backdoor for older versions.
i will not be the only one.
BerkeleyDB-0.06 was the first which refused to compile with 5.00558 and
POLLUTE=1, many others as well.

but POLLUTE=1 seems to be really the easiest way beforehand.
everything is else is a hack.
somewhen the binary compatibility must end. sigh.

Quote:


>>what is the recommended c preprozessor conditional to switch between na
>>and PL_na resp. the old POLLUTEd and the new 5.006 names?

>The "recommended" solution is *not* to use "na" at all but to define a
>local variable, like:

>    STRLEN n_a;

>and use that instead. The reason is that PL_na under threaded Perl becomes
>a per-thread variable.  You'll then need to add a dTHR definition to your

^^^^
this is my problem. these are not my functions. :(
but the issue is getting clearer and clearer to me...

Quote:
>function to access PL_na, which will be an expensive access to
>thread-local storage.  Adding a local STRLEN variable is cheap, backward
>compatible and doesn't need preprocessor conditionals.  It is also what is
>being used in the Perl core.

>-Jan

--                                        
Reini


Fri, 18 Jan 2002 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. PL_na issues (was ANNOUNCE: 5.005_58 perldelta page)

2. Newbie (probably stupid) question: Improved qw operator in perldelta

3. DOC: perldelta.pod for 5.005_55

4. ANNOUNCE: SpiffyCounter 0.25 (Counter+XBM Ticker+Page Statistics)

5. ANNOUNCE: PGPHTML 3.0: a perl script to make PGP signed web-pages

6. ANNOUNCE: cxx2html - Create HTML pages from C++ header files

7. ANNOUNCE: RosettaMan 2.0, a manual page converter

8. ANNOUNCE: PGPHTML 1.3: a perl script to make PGP signed web-pages

9. ANNOUNCE: PGPHTML 1.2: a perl script to make PGP signed web-pages

10. ANNOUNCE: PGPHTML 1.1: a perl script to make PGP signed web-pages

11. Announcing: Personalized Web Page Script

12. Where to start: Need to get page titles from home page and write to txt file

 

 
Powered by phpBB® Forum Software