in reply to Re^3: inserting new lines
in thread inserting new lines
open(FILE, "<myfile.txt"); my $txt = do { local $/; <FILE>}; $txt =~ s/\n{3,}/\n\n/g; close FILE; $txt =~ s/\r|\n//g; $txt =~ s/ /rand() < .5 ? ' ' : "\n"/eg; open(FILE, ">myfile.txt"); print FILE; print FILE $txt; close FILE;
|
|---|