Perl 6 An Introduction to Perl 6 #15

Chained operators, cont'd

Perl 5:

if ( 1 <= $roll1 && $roll1 <= 6 && $roll1 == $roll2 )
    { print "Doubles!"; }

Perl 6:

if ( 1 <= $roll1 == $roll2 <= 6 )
    { print "Doubles!"; }
Copyright © 2008 Patrick Michaud