develooper Front page | perl.perl5.porters | Postings from December 2017

New switch keywords break compatibility

Thread Next
From:
Father Chrysostomos
Date:
December 17, 2017 20:33
Subject:
New switch keywords break compatibility
Message ID:
20171217203311.5675.qmail@lists-nntp.develooper.com
The original reason why the switch feature was enabled via the feature
pragma was to prevent clashes with existing sub names.  The switch
feature is enabled use v5.xx with existing stable versions, which
means that, by changing the keywords, we are introducing an incompati-
bility with existing code that does things like:

    use Unix::Whereis;
    my $ffmpeg = whereis("ffmpeg");

unless we make sure that 'whereis' is overridable.  But even doing that
would not be compatible with code like this:

    sub whereis {
        return if $_[0] =~ /\n/;
        chomp(my $ret = `whereis \Q$_[0]`)
    }
    my $fromp = whereis("fromp");

How do we solve this?  Should we remove the switch feature from exist-
ing feature bundles?

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About