in reply to printing to a file

there's also an entry in the great collection of frequently asked questions, perlfaq. searching for "weird spaces" would have found it.