in reply to Re: script debug
in thread script debug

Just because I learned the flip-flop recently:
#!/usr/bin/perl -n print if (/NAME/../SYNOPSIS/); # then: man ls | this_script.pl
OR maybe you have other plans for the text...
#!/usr/bin/perl $cmd = shift; open MAN, "man - $cmd |"; while (<MAN>) { $section = $_ if /^[ A-Z]+$/; push @lines, $_ if $section =~ /NAME|DESCRIPTION/; } do_something_else_with(@lines); # perhaps get rid of the page headers/footers