in reply to Problems with a regex?

Why not just use smart match instead of grep like so:
sub check_stack { my $stack = $_[0]; if ($stack ~~ @stack) { return 1; } else { return 0; } }

Replies are listed 'Best First'.
Re^2: Problems with a regex?
by dwlepage (Novice) on Aug 15, 2012 at 18:22 UTC
    Thanks everyone. This helped a lot.