extracting NAME and DESCRIPTION sections from pod text file

extracting NAME and DESCRIPTION sections from pod text file

Post by kenper » Mon, 14 Aug 2006 22:36:57


what's correct regular expression on extracting only NAME and
DESCRIPTION section from pod text file?
I have tried this, but failed!

perl -e '$c=`pod2text /data/WebGUI/lib/WebGUI/User.pm`;$c =~
s/(NAME.*)SYNOPSIS/$1/;print $c'

--
perl -e 'print unpack(u,"62V5N\"FME;G\!E<FQ`9VUA:6PN8V]M\"\@``
")'
 
 
 

extracting NAME and DESCRIPTION sections from pod text file

Post by mumia.w.18 » Tue, 15 Aug 2006 00:48:21


foreach $_ (`pod2text /usr/bin/pod2text `) {
if (/^NAME|SYN/../^$/) { print }
}

 
 
 

extracting NAME and DESCRIPTION sections from pod text file

Post by rvtol+new » Tue, 15 Aug 2006 04:34:34

Mumia W. schreef:


Alternative:

/pattern/ and print for `command` ;

--
Affijn, Ruud

"Gewoon is een tijger."
 
 
 

extracting NAME and DESCRIPTION sections from pod text file

Post by foske » Tue, 15 Aug 2006 08:30:05


Assuming POD is =head1 NAME and =head1 SYN match would be:

/^=head[1-4] *(NAME|SYN)/

I think that + would work as well...

/^=head[1-4] +(NAME|SYN)/

I tend not to use + because the grep's that I use do not reliably handle
them and I cannot remember where they work and where they don't.

You might want to add an i to remove case sensitivity.

/^=head[1-4] +(NAME|SYN)/i

Ta
Ken