in reply to Re: Splitting on tabs then removing extra white space with map
in thread Splitting on tabs then removing extra white space with map

Ah! Thank you! That makes much more sense. I tried every context permutation between map and split I could think of.

Modifying $_ in map is a bad idea.

I though this was one of map's strengths? Am I mistaken?

  • Comment on Re^2: Splitting on tabs then removing extra white space with map

Replies are listed 'Best First'.
Re^3: Splitting on tabs then removing extra white space with map
by ikegami (Patriarch) on Sep 18, 2007 at 12:50 UTC
    In what situation would it be a strength? map is usually used as
    my @new = map { ... } @old;

    By changing $_, you *also* change @old in non-obvious manner.