4
0

modifytxt.pl 574 B

123456789101112131415161718192021222324
  1. #!/usr/bin/perl -w
  2. # This is a small script which modifies the outputted txt docs into a more
  3. # readable one, by adding some lines to the output.
  4. use strict;
  5. my $cacheword;
  6. while (<>) {
  7. if ($_ =~ /^(\w+)$/ && $_ !~ /^Name$/) {
  8. $cacheword = $1;
  9. }
  10. if ($_ =~ /^Name$/) {
  11. print "-----------------------\n$cacheword option\n-----------------------\n";
  12. } elsif ($_ =~ /^Description$/) {
  13. print "Description\n-----------\n";
  14. } elsif ($_ =~ /^Synopsis$/) {
  15. print "Synopsis\n--------\n";
  16. } else {
  17. print $_;
  18. }
  19. }