Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: grep and dereferencing an array of arrays

by BillKSmith (Chaplain)
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


Comment on Re: grep and dereferencing an array of arrays
Select or Download Code

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 cooling their heels in the Monastery: (8)
As of 2014-12-27 14:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (177 votes), past polls