in reply to Probably an easy map question

Your usage of map is fine - but it isn't for chomp.

%hash = map { chomp; my ( $a, $b) = split / = /; $a => $b } <INF>;

should do. update: note that $_ is implicit for chomp and split.

Replies are listed 'Best First'.
Re^2: Probably an easy map question
by andye (Curate) on Jan 15, 2009 at 17:02 UTC
    I don't think you need $a and $b, split should do the job by itself:

    my %hash = map {chomp; split / = /} <INT>;
    all the best, andye

      I shouldn't use ($a, $b) since these are special and for something else - but I adhered to the OP's code in order to not change too much... ;-)