in reply to Output not correct

Can someone help me fix it?

Your code as posted doesn't compile, so that's not a great start.

Regardless, you try to match elements in an array to a scalar and are surprised when the match fails. But when it fails all it prints is "No\n\n" which isn't so useful. Why not print $imput_A and @test_input_array? That might make it obvious where you are going wrong.

Other things which don't help your cause here are the inconsistent indentation and the hard-coded pathname which makes for more work for others who might want to help you.

Replies are listed 'Best First'.
Re^2: Output not correct
by davido (Cardinal) on Nov 26, 2018 at 21:45 UTC

    Every time I see posts formatted like this:

    sub foo { foreach my $thing (@_) { # do something } } print "Hello\n"; print "something else\n";

    I take for granted that there's no way the code is going to compile. Not that formatting has anything to do with compiling, but lack of formatting almost guarantees the sort of sloppy attention to detail that will assure compile-readyness is not a foregone conclusion.


    Dave