in reply to Re^2: Failed array attemp
in thread Failed array attemp

I keep getting syntax error and can't change the version so it must be old. Sorry to bother but anyway of making this work without smart catching? (can change slightly by I will be using this scheme a lot so I like the one line clean code. Thanks again.
push @z, (grep { $_ ~~ \@y } @x) ? 'y' : 'n';

Replies are listed 'Best First'.
Re^4: Failed array attemp
by stevieb (Canon) on May 13, 2012 at 22:16 UTC

    If you are going to be "using this scheme a lot", I'd recommend you upgrade, or re-review this post I wrote which is similar to your original code in your question but it actually works.

    Admittedly, I didn't even think to use smartmatch, so kudos to tobyink for that.

    Without smartmatch, I believe you have to do it in two steps.

Re^4: Failed array attemp
by Anonymous Monk on May 13, 2012 at 22:27 UTC
    I guess no other way. Can't really upgrade as I am working on a server and I am not an admin. Thanks steveib I will just use what you wrote :).