#!/usr/bin/perl

use warnings;
use strict;
use v5.10; #for say

use experimental 'smartmatch'; #disable the warning and allow it

my @x = (1,4,2,8);
if (4 ~~ @x) {  #is 4 one or more of the elements in array
    say "yes";
}

if ("hello" ~~ "hello") { #let smartmatch chose between == and eq
    say "matched as strings";
}

if (12 ~~ "12") { #let smartmatch chose between == and eq
    say "matched as numbers";
}
