use Text::Wrap; $file = $ARGV[0]; open(FILE,$file); @text = ; close FILE; open(FH,">new$file"); $Text::Wrap::columns = 40; print wrap('','',@text);