Tag perl

2 bookmarks have this tag.

2025-11-21

2038.

Recipe 8.6. Picking a Random Line from a File (Perl Cookbook)

csg.sph.umich.edu/chen/Perl/cookbook/ch08_07.htm
rand($.) < 1 && ($line = $_) while <>;

Pick a random line from a file without knowing its size beforehand. The algorithm can be easily adjusted to many a thing...

How come Perl is so fun?

2024-05-01

Reposted 1234.

93% of Paint Splatters are Valid Perl Programs | Colin McMillen

www.mcmillen.dev/sigbovik

merely 93% of paint splatters parse as valid Perl.