You can use []
use strict; use warnings; use 5.010; my @array = (); given(@array) { when([]) {say "array is empty"} default { say "there's something"} } my @numbers = (2); if (@numbers ~~ [2]) { say 'yes' }else{ say 'no'; }
In reply to Re: smart match operator should be smarter!
by zwon
in thread smart match operator should be smarter!
by 7stud
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |