Martin Witts

    The grep command tests each element in the array ary and returns a true or false value (according to the equality operator). If any of the elements in ary compare equal to 'foo', then the grep command will return a true value.

    my $foo_exists = grep { $_ eq 'foo' } @ary;
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Playground
    • Snippets
    • Cookbooks
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.