in reply to Re^2: Search element of array in another array
in thread Search element of array in another array

Please mark updates to your nodes, see here for why.

I chomped it like this: ... ';AR9 = 'hat ... The single quotation mark of the predecessing word appears in the sam line.

I'd guess the file is terminated by CRLF and your input record separator $/ is a plain LF. One approach to fix this is to set $/ = "\r\n"; before reading the file and the chomp. If you were using a regular open, you could use the :crlf I/O layer: open my $handle, '<:crlf', 'filename.txt' or die $!; (see PerlIO).

Replies are listed 'Best First'.
Re^4: Search element of array in another array
by Anonymous Monk on Mar 26, 2015 at 20:27 UTC

    ... and File::Slurp::Tiny should allow you to do this: read_lines("filename", chomp=>1, binmode=>":crlf")

Re^4: Search element of array in another array
by better (Acolyte) on Mar 26, 2015 at 20:34 UTC

    All correct!!!

    I put your line into my script and: TATA!!!! It works

    Hours

    and hours

    and hours....

    I love being a scripting amateur. ;-)

    Thanks anonymous monk, you safed my evening! :-))