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.67
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Programming > Libraries

    Text::PORE 1.02

    Download button

    No screenshots available
    Downloads: 398  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Zhengrong Tang | More programs
    Perl Artistic License / FREE
    June 14th, 2007, 12:05 GMT
    ROOT / Programming / Libraries

     Read user reviews (0)  Refer to a friend  Subscribe

    Text::PORE description

    Text::PORE is a Perl Object Rendering Engine.

    Text::PORE is a Perl Object Rendering Engine.

    pore
    intr.v.

    1. To read or study carefully and attentively
    The American Heritage® Dictionary of the English Language, Fourth Edition

    SYNOPSIS

    How to use PORE to render Perl objects.

    use Text::PORE::Template;
    use Text::PORE::Object;

    The Perl object to be rendered:

    $obj = new Text::PORE::Object('name'=>'Joe Smith');
    @chilren = (
    new Text::PORE::Object('name'=>'John Smith', 'age'=>10, 'gender'=>'M'),
    new Text::PORE::Object('name'=>'Jack Smith', 'age'=>15, 'gender'=>'M'),
    new Text::PORE::Object('name'=>'Joan Smith', 'age'=>20, 'gender'=>'F'),
    new Text::PORE::Object('name'=>'Jim Smith', 'age'=>25, 'gender'=>'M'),
    );
    $obj->{'children'} = @chilren;

    The template file (demo.tpl):
    Name: < PORE.render attr=name >
    Children:
    < PORE.list attr=children >
    < PORE.render attr=name >, < PORE.render attr=age >, < PORE.if
    cond="gender EQ 'M'" >Male< PORE.else >Female< /PORE.if >
    < /PORE.list >

    The code that renders the object using this template:

    #
    # create a template
    #
    $tpl = new Text::PORE::Template('file'=>'demo.tpl');

    #
    # render the object using the template
    # the result is printed to STDOUT
    #
    my $fh = new FileHandle();
    $fh->open('>& STDOUT');
    Text::PORE::render($obj, $tpl, $fh);
    $fh->close();

    The rendering result:

    Name: Joe Smith
    Children:

    John Smith, 10, Male

    Jack Smith, 15, Male

    Joan Smith, 20, Female

    Jim Smith, 25, Male

    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    Perl Object | Rendering Engine | Perl module | Text::PORE | Perl | Object

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

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