#!/usr/bin/perl -w use Getopt::Std; our %opts; getopts('fd:', \%opts); if ($opts{f}) { $/ = "\n%\n"; } if ($opts{d}) { $/ = $opts{d}; } while (<>) { chomp; $line = $_ if rand($.) < 1; } print "$line\n";