Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

Re^9: Modernizing the Postmodern Language?

by dsheroh (Monsignor)
on Jul 04, 2020 at 11:01 UTC ( #11118904=note: print w/replies, xml ) Need Help??

in reply to Re^8: Modernizing the Postmodern Language?
in thread Modernizing the Postmodern Language?

Having use 5.whatever imply use compat::perl5 would be a start, at least. But it wouldn't be a 100% solution because a lot of code doesn't bother to specify a Perl version.

IMO, the most straightforward solution seems to be to add an empty compat::perl5 module to the core Perl 5 distribution (and on CPAN), so that Perl 5 will recognize use compat::perl5 as a valid statement, but one which doesn't actually do anything.

Replies are listed 'Best First'.
Re^10: Modernizing the Postmodern Language?
by LanX (Cardinal) on Jul 04, 2020 at 11:30 UTC
    This was about upgrading code which runs equally well on P5 and P7.

    So manually adding a simple use 5... would solve this.

    use compat::Perl5 is IMHO thought to be an automated flag introduced by P7 at compile time when downloading modules from CPAN without P7 meta tag.

    I don't think using it explicitly is a good idea, this would only add to more confusion.

    use 5... is far easier to understand and works out of the box on all older P5 installations.

    It would be nice to see a formal RFC and a test suite covering all disputed edge cases.

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    Wikisyntax for the Monastery

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://11118904]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (8)
As of 2021-04-22 16:39 GMT
Find Nodes?
    Voting Booth?

    No recent polls found