Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Output not correct

by hippo (Bishop)
on Nov 26, 2018 at 19:08 UTC ( [id://1226381]=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1226381]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2024-04-25 15:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found