crunch_this! has asked for the wisdom of the Perl Monks concerning the following question:
Hi, 2nd question here.... I've got a hash whose keys are arrays & I want to get the values of a certain slice & print them out. So it's more complicated than if the keys were just scalars because I have to check each element of each array but I think the printing-out part isn't so bad. Is grep still the right function though? Like
my @wants = grep { something } keys %haystack; print Dumper{@haystack{@wants}};
or maybe
print "@haystack{@wants}\n";Or would I need to use a for or an if first?
edit: for reference this is a continution of this earlier question
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: question about what to grep(?)
by Don Coyote (Hermit) on Apr 12, 2013 at 11:46 UTC | |
|
Re: question about what to grep(?)
by Anonymous Monk on Apr 12, 2013 at 04:13 UTC | |
|
Re: question about what to grep(?)
by AnomalousMonk (Archbishop) on Apr 12, 2013 at 10:20 UTC | |
|
Re: question about what to grep(?)
by hdb (Monsignor) on Apr 12, 2013 at 06:31 UTC | |
by crunch_this! (Acolyte) on Apr 12, 2013 at 15:14 UTC | |
by hdb (Monsignor) on Apr 12, 2013 at 15:52 UTC | |
by crunch_this! (Acolyte) on Apr 12, 2013 at 22:35 UTC | |
by hdb (Monsignor) on Apr 13, 2013 at 08:30 UTC |