in reply to Probably an easy map question

my %h = do { local( @ARGV, $/ ) = ($file); <> =~ /^(.*?) = (.*)/gm };

Replies are listed 'Best First'.
Re^2: Probably an easy map question
by ikegami (Patriarch) on Jan 15, 2009 at 08:56 UTC

    The "$" is useless.

    In the spirit of the OP, here's a (shorter!) variation that uses map:

    my %h = do { local @ARGV = $file; map /^(.*?) = (.*)/, <> };

    One should probably localize $^I when localizing @ARGV.