Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
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;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: weird problem
by Anonymous Monk on Apr 20, 2012 at 22:49 UTC | |
by Anonymous Monk on Apr 21, 2012 at 08:49 UTC | |
|
Re: weird problem
by Riales (Hermit) on Apr 20, 2012 at 21:09 UTC | |
by Anonymous Monk on Apr 20, 2012 at 21:12 UTC |