From toddr at cpanel.net Mon Apr 3 12:25:50 2017 From: toddr at cpanel.net (Todd Rinaldo) Date: Mon, 3 Apr 2017 14:25:50 -0500 Subject: [pm-h] Pod Extract Name In-Reply-To: <1311810924.7548954.1490989261298@mail.yahoo.com> References: <1311810924.7548954.1490989261298.ref@mail.yahoo.com> <1311810924.7548954.1490989261298@mail.yahoo.com> Message-ID: <519002D7-3D41-4160-A23A-7B29F4F193E4@cpanel.net> It depends on how regular your data is and how lazy you want to be. You could do something like this from shell: cd $my_base_dir for file in `grep -Rl 'head1 NAME' *`; do echo $file `grep -A2 'head1 NAME' $file|tail -1` done > On Mar 31, 2017, at 2:41 PM, Michael R. Davis wrote: > > Houston PMs, > I need to pull the pod NAME for all of my .pm files for a report. There are so many POD this and that's on CPAN that I cannot find a pod parser that is simply like this. > > my $pod = XXX->new(file=>"xxx.pm"); > my $name = $pod->name; #or $pod->head1("NAME"); > > Where $name would pull the "content" from the pod NAME section. > > =head1 NAME > > content > > =cut > > Does anyone have a favorite POD object? > Mike > > mrdvt92 > > > _______________________________________________ > Houston mailing list > Houston at pm.org > http://mail.pm.org/mailman/listinfo/houston > Website: http://houston.pm.org/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From mrallen1 at yahoo.com Mon Apr 3 16:15:08 2017 From: mrallen1 at yahoo.com (Mark Allen) Date: Mon, 3 Apr 2017 23:15:08 +0000 (UTC) Subject: [pm-h] Pod Extract Name References: <788254255.10156538.1491261308941.ref@mail.yahoo.com> Message-ID: <788254255.10156538.1491261308941@mail.yahoo.com> Sounds like you want https://metacpan.org/pod/Pod::Simple::SimpleTree or something close to that. In any case, Pod::Simple is the correct parent for whatever it is you want to build. Mark On Monday, April 3, 2017 2:27 PM, Todd Rinaldo wrote: It depends on how regular your data is and how lazy you want to be. You could do something like this from shell: cd $my_base_dir for file in `grep -Rl 'head1 NAME' *`; do echo $file `grep -A2 'head1 NAME' $file|tail -1` done On Mar 31, 2017, at 2:41 PM, Michael R. Davis wrote: > >Houston PMs, >I need to pull the pod NAME for all of my .pm files for a report. There are so many POD this and that's on CPAN that I cannot find a pod parser that is simply like this. > > >my $pod = XXX->new(file=>"xxx.pm"); >my $name = $pod->name; #or $pod->head1("NAME"); > > >Where $name would pull the "content" from the pod NAME section. > > >=head1 NAME > > > >content > > >=cut > > >Does anyone have a favorite POD object? > >Mike > > >mrdvt92 > > > >_______________________________________________ >Houston mailing list >Houston at pm.org >http://mail.pm.org/mailman/listinfo/houston >Website: http://houston.pm.org/ _______________________________________________ Houston mailing list Houston at pm.org http://mail.pm.org/mailman/listinfo/houston Website: http://houston.pm.org/ From mrdvt92 at yahoo.com Tue Apr 4 21:27:18 2017 From: mrdvt92 at yahoo.com (Michael R. Davis) Date: Wed, 5 Apr 2017 04:27:18 +0000 (UTC) Subject: [pm-h] Pod Extract Name In-Reply-To: <788254255.10156538.1491261308941@mail.yahoo.com> References: <788254255.10156538.1491261308941.ref@mail.yahoo.com> <788254255.10156538.1491261308941@mail.yahoo.com> Message-ID: <2022437222.187719.1491366438414@mail.yahoo.com> >> On Mar 31, 2017, at 2:41 PM, Michael R. Davis wrote:>> I need to pull the pod NAME for all of my .pm files for a report. ?>> There are so many POD this and that's on CPAN that I cannot find?>> a pod parser > From: Mark Allen > Sounds like you want https://metacpan.org/pod/Pod::Simple::SimpleTree?> or something close to that. Not the cleanest API that I've seen but it works. ?I'm still surprised there are no OO pod parsers. perl -e 'use strict;use warnings;use Pod::Simple::SimpleTree;use Data::Dumper qw{Dumper}; while (my $file=shift) {? #print "$file\n";?? my $pod=Pod::Simple::SimpleTree->new->parse_file($file)->root;?? #print Dumper($pod);? {? ? my @copy = @$pod;? ? while (@copy) {? ? ? my $object = shift @copy;? ? ? #print Dumper($object);? ? ? last if (ref($object) eq "ARRAY" and $object->[0] eq "head1" and $object->[2] eq "NAME");? ? }? ? my $object = shift @copy;? ? my $text ? = $object->[2];? ? print "$file - $text\n";? }}' `find -name "*.p?" This pulls the pod NAME from 2039 Perl files. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gwadej at anomaly.org Sun Apr 9 16:09:16 2017 From: gwadej at anomaly.org (G. Wade Johnson) Date: Sun, 9 Apr 2017 18:09:16 -0500 Subject: [pm-h] April Houston.pm meeting: A Discussion About p5hack Message-ID: <20170409180916.03b39619@cygnus> At the April meeting, Todd Rinaldo will tell about a recent visit to p5hack and lead a discussion on what is coming to Perl. The meeting will be held at Hostgator, on Thursday, April 13, starting at 7pm. I look forward to seeing you all there, G. Wade -- The function of good software is to make the complex appear to be simple. -- Grady Booch From gwadej at anomaly.org Sun Apr 9 16:35:52 2017 From: gwadej at anomaly.org (G. Wade Johnson) Date: Sun, 9 Apr 2017 18:35:52 -0500 Subject: [pm-h] Potential position in California Message-ID: <20170409183552.2a1c389d@cygnus> Apologies for the (sort of) job posting. A friend has contacted me about an interesting position in California. This is not a Perl position, but there is some potential for backend and/or frontend work on a web application and/or an iOS app. If you are interested and would be willing to go to CA, contact me and I can get you more details. I won't post anything more about this. So back to our normal list. G. Wade -- "The avalanche has already started. It is too late for the pebbles to vote." -- Ambassador Kosh, "Believers"