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

New switch keywords break compatibility

Thread Next
Father Chrysostomos
December 17, 2017 20:33
New switch keywords break compatibility
Message ID:
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 Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About