in reply to removing all whitespace but newlines

One solution, assuming that the twelve chars are at the start of each line:
local $\ = "\n"; while(<>) { print substr $_, 0, 12 }

-- integral, resident of freenode's #perl