Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com X-MimeOLE: Produced By Microsoft Exchange V6.0.5762.0 content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Subject: RE: Perl documentation Date: Thu, 25 Oct 2001 16:16:14 -0700 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Perl documentation Thread-Index: AcFdqniCxPkdzwL9RA2JVn6gUhZMhgAACSfw From: "Stephan Mueller" To: X-OriginalArrivalTime: 25 Oct 2001 23:16:18.0869 (UTC) FILETIME=[0D666650:01C15DAB] Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id f9PNJHm18693 And somehow, it seems just a bit... wrong to be using awk for this. Somehow perl just seems more appropriate. But whatever gets it done. "There's more than one way to do it" and all that. stephan(); -----Original Message----- From: Gerrit P. Haase [mailto:gp AT familiehaase DOT de] Sent: Thursday, October 25, 2001 3:58 PM To: libwww AT perl DOT org Cc: cygwin AT cygwin DOT com Subject: Re: Perl documentation Hallo Martin, Am 2001-10-24 um 10:10 schriebst du: > Hi you, > although the concern of my mail not actually within the topic of this > mailing list, I think it will be of interest for you. After typing the > following verses in a Linux shell you'll get the pod code within the > pm's of your perl library transformed into html. The resulting > HTML-document is being moved to /usr/local/doc/perl5, for instance. > The directory tree there will parallel to that on /usr/lib/perl5 (or > where ever you keep it). > Requires: find, awk, tee, pod2html, a preinstalled destination > directory. > Lacks: Not all pm's contain pod code. There will be html-files with 0 > bytes length, however. > 1.) cd /usr/lib/perl5 > 2.) find -name \*.pm | awk '{dir=$1; html=gensub("\.pm","\.html","",dir); > system("pod2html " $1 " | tee " html); > sub("\.","\/usr\/local\/doc\/perl5",dir); > sub("\/[[:alnum:]_-]*.pm","",dir); > system("mkdir " dir); > system("mv " html " " dir "/")}' > Never mind the linefeeds in here, this is a one-liner. Always type the > spaces exactly, as awk uses them for concatenation. So why not write it down so we can copy and paste it? And I suggest to use mkdir -p to get rid of the useless errors. #!/usr/bin/sh cd /usr/lib/perl5 find -name \*.pm |awk '{dir=$1; html=gensub("\.pm","\.html","",dir); \ system("pod2html " $1 " | tee " html); \ sub("\.","\/usr\/local\/doc\/perl5",dir); \ sub("\/[[:alnum:]_-]*.pm","",dir); \ system("mkdir -p " dir); \ system("mv " html " " dir "/")}' # Happy Perl'ing;) Ciao, Gerrit P. Haase mailto:gp AT familiehaase DOT de -- =^..^= -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/ -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/