in reply to Re^6: Switch.pm Failure
in thread Switch.pm Failure
i would have done Switch sub {...}
Ok, but without the sub is also not uncommon, for example I'd say Try::Tiny's sub try (&;@) clearly looks better when written try { ... } catch { ... };.
In regards to your other post:
the whole (logical-test) && do { process-stmts} ; setup while legal is very "un-perlish"
I disagree, I think it's very perlish, in fact probably "too" perlish! ;-)
given/when
Note that these were retroactively marked experimental as of v5.16, and will generate warnings in Perl v5.18 and above:
It is clear that smartmatch is almost certainly either going to change or go away in the future. Relying on its current behavior is not recommended.
|
|---|