lembark has asked for the wisdom of the Perl Monks concerning the following question:

Nothing in perldelta describes this difference; can't find any ref's via google or search on 5.10/mulitple/package.

Oddity: with use v5.10.0 (in any of the stringy versions), a second package delivers a syntax error. For example, the code below fails with:

syntax error at line 6, near "package bar"

Adding semi-colons after the sub's allows the code to compile, but I don't remember seeing anything about semicolons being required after sub def's -- even ones before package declarations.

Or is there something else in the perldelta that I've missed?

use v5.10.0; package foo; foo {} package foo::bar; bar {} 1 __END_
so much for my editing skills -- sorry for wasting your time -- the original was frying itself with the subs in place.

Replies are listed 'Best First'.
Re: 5.10.0 seems to break package
by Joost (Canon) on Jul 10, 2009 at 20:00 UTC
    foo {} is a CALL to a function named foo, passing a hashref - not a function declaration. You need a semi-colon after a function call. update: well, most of the time - not at the end of a file or block, for example, but you do need one before starting a new package.

    You probably meant something like:

    package foo; sub foo {} package foo::bar; sub bar {}
    Note the subs.
Re: 5.10.0 seems to break package
by ikegami (Patriarch) on Jul 10, 2009 at 20:06 UTC
    Contrary to your implications, the missing "sub" tokens or semicolons (";") are also errors without the use line and in versions earlier than 5.10.