#!/usr/bin/perl -w # # tagline -- read taglines from stdin, display randomly tagline # # Copyright (c) 1997, Charles W. Sharp # # You may distribute tagline under the terms of the GNU General Public # License as specified by the Free Software Foundation. # # Bug reports, comments, or anything else: # # Charles W. Sharp # csharp@swlink.net # Phoenix, AZ # # tagline-1.0 # # Invocation: tagline [ file1 [file2...] ] # or # zcat file.gz | tagline # # Notes: # Taglines must be separated by "\n%\n" or you must change $/ to reflect field # separator # # $/ = "\n%\n"; srand; rand($.) < 1 && ($_ eq "\n" || ($it = $_)) while <>; chop $it; chop $it; print $it;