Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.2 / 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 > Perl Modules

    PurpleWiki::View::Driver 0.94

    Download button

    No screenshots available
    Downloads: 386  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    Good (3.5/5)
    11 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Matthew O'Connor | More programs
    Perl Artistic License / FREE
    May 5th, 2008, 11:29 GMT
    ROOT / Programming / Perl Modules

     Read user reviews (0)  Refer to a friend  Subscribe

    PurpleWiki::View::Driver description

    PurpleWiki::View::Driver is a Perl module to view driver base class.

    PurpleWiki::View::Driver is a Perl module to view driver base class.

    SYNOPSIS

    The PurpleWiki::View::Driver is primarily used as a base class, because by itself it doesn't do anything but traverse a PurpleWiki::Tree. This example defines a view driver that extracts image links from a PurpleWiki::Tree.

    package PurpleWiki::View::getImages;
    use strict;
    use warnings;
    use PurpleWiki::View::Driver;

    use vars qw(@ISA);
    @ISA = qw(PurpleWiki::View::Driver);

    sub new {
    my $prototype = shift;
    my $class = ref($prototype) || $prototype;
    my $self = $class->SUPER::new(@_);

    # Object State
    $self->{images} = [];

    bless($self, $class);
    return $self;
    }

    sub view {
    my ($self, $tree) = @_;
    $self->SUPER::view($tree);
    return @{$self->{images}};
    }

    sub imageMain {
    my ($self, $nodeRef) = @_;
    push @{$self->{images}}, $nodeRef->href;
    }

    1;

    PurpleWiki::View::Driver is the base class used by all of the view drivers. Its default behavior is to recurse down a PurpleWiki::Tree depth first from left most (oldest) child to right most (youngest) child. Child nodes are represented as a list within a PurpleWiki::Tree, so left most means the first child in the list and right most means the last child in the list.

    Other than the methods mentioned in the METHODS section, this class also uses AUTOLOAD to export pre, main, and post handling methods for every node type. Three generic handlers are also exported via AUTOLOAD and they are called simply "Pre()", "Main()", and "Post()" and get called on every node.

    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    driver base class | PurpleWiki driver | Perl module | PurpleWiki | driver | Perl

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

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