Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: grep and dereferencing an array of arrays

by BillKSmith (Curate)
on Sep 07, 2013 at 14:41 UTC ( #1052816=note: print w/ replies, xml ) Need Help??


in reply to grep and dereferencing an array of arrays

use strict; use warnings; my $qablock = [ [qw(r0c0 r0c1 r0c2)], [qw(r1c0 r1c1 r1c2)], [qw(r2c0 r2c1 r2c2)], ]; my $answer = 'r1c0'; my ($usefulans) = grep {$$_[0] eq $answer} @$qablock; print "\t\t----> @$usefulans\n";
Output:
----> r1c0 r1c1 r1c2
Bill

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1052816]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (7)
As of 2016-07-01 02:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My preferred method of making French fries (chips) is in a ...











    Results (405 votes). Check out past polls.