in reply to Re: grep confusion
in thread grep confusion

The function first_value (from List::MoreUtils) is slightly better than grep because it returns the single value that you expect as a scalar.
use strict; use warnings; use List::MoreUtils qw(first_value); my(%DetailSheet) = ( ... ); my %Column = %{$DetailSheet{ColumnName}}; my $description = first_value {$Column{$_}{XlsColumn} == 2} keys %Colu +mn; print $description, "\n";
Bill

Replies are listed 'Best First'.
Re^3: grep confusion
by LanX (Saint) on Sep 01, 2017 at 14:15 UTC
    IMHO it's unclear from the OP s description how many results he expects.

    Cheers Rolf
    (addicted to the Perl Programming Language and ☆☆☆☆ :)
    Je suis Charlie!

Re^3: grep confusion
by PriNet (Monk) on Sep 03, 2017 at 00:23 UTC
    I will need to look into that Bill, I'm always looking for shortcuts !

    I tried re-inventing the wheel again, but everytime I push it, it still falls flat on it's side...