in reply to Failed array attemp
"... I want to finally start making my code shorter."
You could use push() just once in the line:
any{$x == $_ } @y ? push(@z, "y") : push(@z, "n");
by writing:
push @z, any {$x == $_ } @y ? "y" : "n";
That's really just intended as an example. stevieb has provided an excellent response with a complete script above.
"I really want to use the ? : ; scheme properly ..."
Take a look at: Short form (ternary) if else. It discusses many aspects of ternary operator usage.
-- Ken
|
|---|