Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.3 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67a
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Programming > Perl Modules

    Pod::Snippets 0.14

    Download button

    No screenshots available
    Downloads: 242  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Dominique QUATRAVAUX | More programs
    Perl Artistic License / FREE
    December 11th, 2008, 12:37 GMT
    ROOT / Programming / Perl Modules

     Read user reviews (0)  Refer to a friend  Subscribe

    Pod::Snippets description

    Extract and reformat snippets of POD so as to use them in a unit test (or other Perl code)

    Pod::Snippets is a Perl module that extract and reformat snippets of POD so as to use them in a unit test (or other Perl code).

    SYNOPSIS

     use Pod::Snippets;

     my $snips = load Pod::Snippets($file_or_handle,
     -markup => "test");

     my $code_snippet = $snips->named("synopsis")->as_code;

     # ... Maybe borg $code_snippet with regexes or something...

     my $result = eval $code_snippet; die $@ if $@;

     like($result->what_happen(), qr/bomb/);

    The Perl code that we want to extract snippets from might look like this:

     package Zero::Wing;

     =head1 NAME

     Zero::Wing - For great justice!

     =head1 SYNOPSIS

     =for test "synopsis" begin

     use Zero::Wing;

     my $capitain = Zero::Wing->capitain;

     =for test "synopsis" end

     =cut

     # ...

     1;


    This class is a very simple extension of Pod::Parser that extracts POD snippets from Perl code, and pretty-prints it so as to make it useable from other Perl code. As demonstrated above, Pod::Snipets is immediately useful to test-driven-development nutcases who want to put every single line of Perl code under test, including code that is in the POD (typically a SYNOPSIS section). There are other uses, such as storing a piece of information that is both human- and machine-readable (eg an XML schema) simultaneously as documentation and code.


    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    reformat snippets | extract snippets | Perl module | POD | snippets | Perl

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM