in reply to Search element of array in another array
See the Basic debugging checklist: use Data::Dumper or Data::Dump to see what your data structures really look like. I'm guessing you will indeed find that your array contains only one element. The reason seems to be in the File::Slurp::Tiny docs: the documentation for read_file says: "Reads file $filename into a scalar. By default it returns this scalar.", implying that the entire file is read and returned as one scalar. You should probably try using the read_lines function instead. You should probably also turn on the chomp option.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Search element of array in another array
by better (Acolyte) on Mar 26, 2015 at 20:08 UTC | |
by Anonymous Monk on Mar 26, 2015 at 20:21 UTC | |
by Anonymous Monk on Mar 26, 2015 at 20:27 UTC | |
by better (Acolyte) on Mar 26, 2015 at 20:34 UTC | |
by Anonymous Monk on Mar 26, 2015 at 20:13 UTC | |
|
Re^2: Search element of array in another array
by better (Acolyte) on Mar 26, 2015 at 19:52 UTC |