#!/usr/bin/perl -p # list -- escape code listing for troff # Permission to use, copy, modify and/or # distribute this software for any purpose # with or without fee is hereby granted. use Getopt::Std; BEGIN { getopt('Ep:s:') } if (/^\.\s*\(l\s*$/ .. /^\.\s*\)l\s*$/) { not $opt_E and s/^\\!// and next; if (/^\.\s*\(l\s*$/) { $_ = ''; $_ = "$opt_p\n" if $opt_p; } elsif (/^\.\s*\)l\s*$/) { $_ = ''; $_ = "$opt_s\n" if $opt_s; } else { s/\\/\\$&/g; s/^/\\&/g; s/'/\\(aq/g; s/\`/\\(ga/g; } }