3 ms·
This doesn't come with an elaborate test suite, but it does pretty much everything that does in a few dozen lines of Perl. https://github.com/neilk/misc/blob/m
by neilk 14y ago
This doesn't come with an elaborate test suite, but it does pretty much everything that does in a few dozen lines of Perl.
https://github.com/neilk/misc/blob/master/randline https://github.com/neilk/misc/blob/master/randline
I've had this script (or versions of it) around for more than a decade. I didn't know the technique had a name.
- andrewcooke 14y agoit was an example in the original camel book. [edit: i was going to delete this, but since you replied i'll leave it - it does appear (too?) in the camel book, on p 246 of my copy, but like you say, it's for a single line. hadn't opened that book in years, took me some time to find it...]
- neilk 14y agoI believe it was an example in the Perl Cookbook, but for picking a single line only. (Ancient UseNet thread: http://bit.ly/Thd4eE http://bit.ly/Thd4eE)
- snoble 14y agothe code isn't special. but it's easy for anyone to install and use