in reply to Chomp is removing the whole word instead of the newline

Your last example works for me, that's how chomp should be used. The output:
col2fd1fd2fd3fd4
Notice there is no newline at the end. The output might be buffered, i.e. it will not be shown before you print a newline or finish the script.

Replies are listed 'Best First'.
Re^2: Chomp is removing the whole word instead of the newline
by slayedbylucifer (Scribe) on Jul 25, 2012 at 09:55 UTC
    exactly. On my fedora, It does show output. But on my ubuntu, it does not show any output unless I add "\n" to the print statement. Is this an expected behaviour ?