PrePAN

Sign in to PrePAN

Perl::Critic::Policy::ProhibitSmartmatch Perl::Critic policies which help to avoid both explicit and implicit smartmatching

Good

Synopsis

    # Perl::Critic::Policy::Operators::ProhibitSmartmatch
    # will complain about using ~~

    if ($foo ~~ [ $bar ]) {
        say 'No!';
    }

    # Perl::Critic::Policy::ControlStructures::ProhibitSwitchStatements
    # will complain about using given/when/default
    
    given ($foo) {
        when (42) { say 'Heureka!'; }
        default { die 'Oh!'; }
    }

Description

Comments

This looks good to me and is something I would probably use.

Please sign up to post a review.