in reply to I don't get map. How would I use map here?

Not sure if you're looking to replace both loops entirely or whether you need %byFile for other purposes ...

print map {join("\t=>", reverse split) . "\n"} <DATA>;

Update: replaced superflous foreach after print

Replies are listed 'Best First'.
Re^2: I don't get map. How would I use map here?
by Not_a_Number (Prior) on Jun 18, 2004 at 23:19 UTC
    Update: replaced superflous foreach after print

    You could also remove the superfluous map :-)

    print join ( "\t=>", reverse split ) . "\n", <DATA>;

    Update: Sorry, ignore

      Not without putting it in a different loop:
      print join("\t=>", reverse split), "\n" while <DATA>;

      We're not really tightening our belts, it just feels that way because we're getting fatter.