in reply to Re^2: Help understand why this grep does not work
in thread Help understand why this grep does not work
my %data_hash = map { /(\w\s+\d)/ => $_ } @data2; for my $key ( %data_hash ) { print "$data_hash{$key}\n" if grep { /^$key/ } @data1; }
I also wondered about anchoring that match. In earlier versions, I did anchor it. But, I wasn't sure if it was necessary given the data set. I think I'll add it back as it's probably safer.
Thanks for the advice!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Help understand why this grep does not work
by LanX (Saint) on Nov 02, 2013 at 16:21 UTC | |
by drmrgd (Beadle) on Nov 02, 2013 at 16:46 UTC | |
by LanX (Saint) on Nov 02, 2013 at 16:59 UTC | |
by drmrgd (Beadle) on Nov 02, 2013 at 17:10 UTC |