Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • Great work, masak. I started using that in Padre::Plugin::Perl6 to index Perl6 functions.

    A more safe one-liner that works even on win32 platforms.

    perl -e "$_ = <> until /Function Packages/; while (<>) { if (/^=(\S+) (.*)/) { next if $1 eq q{over}; print q{ } x 4 if $1 eq q{item}; print qq{$2\n} } }" S29-functions.pod
    • Great work, masak. I started using that in Padre::Plugin::Perl6 to index Perl6 functions.

      Happy to hear that.

      A more safe one-liner that works even on win32 platforms.

      perl -e "$_ = <> until /Function Packages/; while (<>) { if (/^=(\S+) (.*)/) { next if $1 eq q{over}; print q{ } x 4 if $1 eq q{item}; print qq{$2\n} } }" S29-functions.pod

      That version may work on win32 platforms, but it doesn't in bash, which does variable interpolation of double-quoted strings. Single quotes work.

      Thanks for the tip about q{} and qq{}, though! I really should remember to use those more in one-liners, where single quotes are essentially hijacked by the -e string.

      • Cool. Thanks for the bash tip.

        Please take a look at the updated code for parsing S29 for documentation and selecting the correct one. I think S29 needs to be updated in some =item-s to be more consistent.

        http://padre.perlide.org/browser/trunk/Padre-Plugin-Perl6/lib/Pad re/Plugin/Perl6.pm.