in reply to Building a chomped hash from a file

my %an_hash = grep [chomp], <A_File>;

Replies are listed 'Best First'.
Re^2: Building a chomped hash from a file
by sauoq (Abbot) on Oct 30, 2005 at 20:36 UTC

    While I like this, I think it is more obfuscated than I'd like to see in serious code. I'd even prefer 1+chomp to [chomp]. Even so, it's an unexpected use of grep and I'd probably avoid it.

    -sauoq
    "My two cents aren't worth a dime.";