Help for this page

Select Code to Download


  1. or download this
    say grep { REGEX } @list;
    #doesn't work, because it isn't really doing what you think it is doin
    +g
    ...
    my $regex = qr/string/;
    say grep { /$regex/ } @list;
    #this works (and, as expected, gives same bad result you got if // is 
    +removed)