From: Tim Bunce Date: Fri, 3 Jan 1997 17:48:46 +0000 (+0000) Subject: Re: perldelta, take 3 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=7cfe7857715f78206e6d7d6f7fd52983de4dec44;p=p5sagit%2Fp5-mst-13.2.git Re: perldelta, take 3 > From: Tom Christiansen Some quick thoughts: > =head1 NAME > > perldelta - what's new for perl5.004 (version 0.3) To avoid any confusion: s/version/perldelta version/ > =head2 Internal Change: Safe Module Absorbed into Opcode > > A new Opcode module subsumes 5.003's Safe module. The Safe > interface is still available, so existing scripts should still > work, but users are encouraged to read the new Opcode documentation. > (Note too, that after 5.004 is installed, you will no longer be > able to run Safe under the 5.003 binary.) Opcode does not supercede Safe. Safe is now implemented on top of Opcode. Opcode is purely functional. Safe implements OO 'compartments'. I'd suggest you say something like: =head2 New Opcode Module and Revised Safe Module A new Opcode module supports the creation, manipulation and application of opcode masks. The revised Safe module has a new API and is implemented using the new Opcode module. Users are encouraged to read the new Opcode and Safe documentation. (Note too, that after 5.004 is installed, you will no longer be able to run Safe under the 5.003 binary.) > =item use Module VERSION LIST > > If the VERSION argument is present between Module and LIST, then the > C will fail if the $VERSION variable in package Module is > less than VERSION. > > Note that there is not a comma after the version! + This is similar to the existing version checking mechanism in the + Exporter module but it's faster and can be used with modules that + don't use the Exporter. It is the recommended method for new code. > =head2 New Built-in Methods > > The C package automatically contains the following methods that > are inherited by all other classes: > > =item isa ( CLASS ) > =item can ( METHOD ) > =item VERSION ( [ VERSION ] ) > > use A 1.2 qw(some imported subs); > > A->VERSION( 1.2 ); > $ref->is_instance(); # True I don't see is_instance described anywhere. I think it needs a few words. > =head1 Pragmata > > Three new pragmatic modules exist: > > =item use ops > > Restrict unsafe operations when compiling ! Disable named/unsafe opcodes when compiling perl code > =head1 Efficiency Enhancements > > All hash keys with the same string are only allocated once, so > even if you have 100 copies of the same hash, the immutable keys > never have to be re-allocated. > > Functions that do nothing but return a fixed value are now inlined. ! Functions with an empty prototype that do nothing but return a ! fixed value are now inlined. E.g., sub PI () { 3.14159 } p5p-msgid: <9701031748.AA15335@toad.ig.co.uk> --- diff --git a/pod/perlnews.pod b/pod/perlnews.pod index 0af4e4e..6c12d29 100644 --- a/pod/perlnews.pod +++ b/pod/perlnews.pod @@ -25,6 +25,13 @@ binary compatibility with Perl 5.003. If you choose binary compatibility, you do not have to recompile your extensions, but you might have symbol conflicts if you embed Perl in another application. +=head2 New Opcode Module and Revised Safe Module + +A new Opcode module supports the creation, manipulation and +application of opcode masks. The revised Safe module has a new API +and is implemented using the new Opcode module. Please read the new +Opcode and Safe documentation. + =head2 Internal Change: FileHandle Deprecated Filehandles are now stored internally as type IO::Handle. @@ -33,12 +40,6 @@ are still supported for backwards compatibility C (or C or C) and C<*STDOUT{IO}> are the way of the future. -=head2 Internal Change: Safe Module Absorbed into Opcode - -A new Opcode module subsumes 5.003's Safe module. The Safe -interface is still available, so existing scripts should still -work, but users are encouraged to read the new Opcode documentation. - =head2 Internal Change: PerlIO internal IO abstraction interface. It is now possible to build Perl with AT&T's sfio IO package @@ -168,6 +169,11 @@ the Universal class, croaks if the given version is larger than the value of the variable $Module::VERSION. (Note that there is not a comma after VERSION!) +This version-checking mechanism is similar to the one currently used +in the Exporter module, but it is faster and can be used with modules +that don't use the Exporter. It is the recommended method for new +code. + =item prototype(FUNCTION) Returns the prototype of a function as a string (or C if the @@ -321,7 +327,7 @@ See L for more information. =item use ops -Restricts unsafe operations when compiling. +Disable unsafe opcodes, or any named opcodes, when compiling Perl code. =back @@ -419,7 +425,8 @@ All hash keys with the same string are only allocated once, so even if you have 100 copies of the same hash, the immutable keys never have to be re-allocated. -Functions that do nothing but return a fixed value are now inlined. +Functions that have an empty prototype and that do nothing but return +a fixed value are now inlined (e.g. C). =head1 Documentation Changes