I have updated the code with few of your comments
The solution was in the last one though. Your analysis was correct (at least it's part of the issue), the fact that @fillarr contains quotes ("computer" rather than just computer) makes the comparison fail. You should create your $csv object like this: my $csv = Text::CSV->new ({ binary => 1, sep_char => ";" }); (the sep_char part is required). And then replace my (@fillarr) = split ';',$line; by using $csv->parse on $line, and then using $csv->fields.

Also please, replace your first open by open my $types, "<", "types.txt" or die $!; then read with <$types>

And even if the code doesn't work as you want, please make sure that the code you post here at least compiles ;-)

Edit: oh and LanX is right, it would be far easier for us to help you with data (ie, an example of what your two files look like). But that's part of what you need for a short, working example (so again, what hippo asked).


In reply to Re^7: String comparison in an array by Eily
in thread String comparison in an array by newperlbie

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.