The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

PNI - Perl Node Interface

ATTENTION

This module was created to be used internally by a GUI, anyway you are free to use the scripting api if it does make sense.

INSTALLATION

To install PNI module plus a basic set of PNI nodes, do:

    cpan PNI::Core

SYNOPSIS

    use PNI ':-D'; # imports node, edge and task

    my $node = node 'Perlfunc::Print';
    $node->get_input('list')->set_data('Hello World !');
    $node->get_input('do_print')->set_data(1);

    task; # prints Hello World !

DESCRIPTION

Hi all! I'm an italian mathematician. I really like Perl philosophy as Larry jokes a lot even if he is one of the masters of hacking.

PNI stands for Perl Node Interface.

It is my main project, my contribution to the great Perl community. Node programming is really interesting since makes possible to realize a program even if you have no idea about programming.

Think about genetic researchers, for example. They need to focus on protein chains, not on what a package is. Maybe they can do an extra effort and say the world "variable" or "string" or even "regular expression" and that makes them proud, but they don't care about inheritance.

They want things working and they need Perl ...

but if you say Strawberry they think about yogurt, not about Windows.

There are a lot of node programming languages (VVVV, Puredata, Max/Msp) but normally they target artists and interaction designers. I saw a lot of vjs and musicians do really complex programs with those software, and they never wrote a line of code.

This is my effort to provide a node interface that brings Perl power to people who don't know the Perl language.

Blah blah blah. ( this was the h2xs command :-)

METHODS

edge

    my $source_node = PNI::node 'Some::Node';
    my $target_node = PNI::node 'Another::Node';

    my $edge = PNI::edge $source_node    => $target_node , 
               'source_output_name' => 'target_input_name';

Connects an output of a node to an input of another node.

files

    my @pni_files = PNI::files;

Returns a list of all .pni files in PNI.pm install dir and subdirs.

node

Creates a node by its PNI type, that is the name of a package under the PNI::Node namespace, and adds it to the root scenario. If you write

    my $node = PNI::node 'Foo::Bar';

PNI loads and inits PNI::Node::Foo::Bar node.

If no PNI type is passed, and you just write

    my $node = PNI::node;
    

PNI creates an empty node.

node_list

    my @nodes = PNI::node_list;

Returns a list of available PNI nodes.

This method delegates to PNI::Finder nodes method.

task

    PNI::task;

Calls the task method for every loaded node. This method delegates to the root scenario task method.

loop

    PNI::loop;

Starts the PNI main loop. It keeps calling task as fast as it can.

root

    my $root = PNI::root;

Returns the root PNI::Scenario.

SEE ALSO

PNI::Core

PNI::GUI::Tk

PNI blog

AUTHOR

G. Casati , <fibo@cpan.org>

LICENSE AND COPYRIGHT

Copyright (C) 2009-2011, Gianluca Casati

This program is free software, you can redistribute it and/or modify it under the same terms of the Artistic License version 2.0.