Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Output not correct

by tinita (Parson)
on Nov 26, 2018 at 19:15 UTC ( #1226385=note: print w/replies, xml ) Need Help??


in reply to Output not correct

Ok, this is called debugging and it will probably also help you in the future.
When a pattern matching or a comparison or a grep does not work like you think it should, you can simply print the contents of the variable(s).
use Data::Dumper; local $Data::Dumper::Useqq = 1; # show things like newlines, tabs as " +\n", "\t" print Dumper $input_A; print Dumper \@test_input_array;
I suspect the elements in @test_input_array have spaces where you don't expect them (you split on a single comma and forget about the spaces).

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (8)
As of 2019-10-21 20:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?