in reply to Re^2: Compare two arrays
in thread Compare two arrays
%seen{$_} is incorrect, you're only accessing one element (ie: a scalar) so you have to use the sigil $: $seen{$_}
Now, look at your dump of \%test, you'll see that the value in $seen{$_} is actually an array, not a string, unless you have changed your data structure since the first post.
Now your grep test (if I ignore your previous errors), applied to 96329XY and 96329XY_K.txt would turn into : "96329XY" =~ /96329XY_K.txt/, you probably have the wrong order. And you probably want to use quotemeta: grep { $filename =~ /\Q$_/ } keys %seen.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Compare two arrays
by Anonymous Monk on Oct 01, 2014 at 17:57 UTC | |
by Eily (Monsignor) on Oct 01, 2014 at 22:26 UTC |