Janus::Sequence::Code - Load maintenence plugin code.
use Janus::Sequence::Code; my $code = Janus::Sequence::Code->load( '/code/file' ); my ( $alpha, $omega ) = $code->dump( 'alpha', 'omega' );
Code file is expected to contain a package Janus::Plugin, where our $STATIC may be defined with a true value - a hint that our variables in this package should have a static effect.
Also, the package must return a HASH of ARRAY of CODE indexed by stage names.
Top level HASH consists of ARRAYs indexed by sequence names. Each ARRAY consists of CODE indexed by stage names. i.e. ARRAY is a flattened HASH, which guarantees order of stage invocations.
Load code from file. Returns object.
Returns code identified by @name.
Returns true if static hint is on, false otherwise.
## this file may have any name, despite the package it contains. package Janus::Plugin; use strict; use Data::Dumper; ## hint: modifications on our variables persist through all sub calls. our $STATIC = 1; our ( $foo, $bar ) = qw( foo bar ); our %hash = ( foo => 1, bar => 1 ); return ( alpha => [ foo => sub { print "$foo\n"; $bar = 'baz'; }, bar => sub { print "$bar\n"; $foo = 'bar'; delete $hash{foo}; } ], omega => [ foo => sub { print "$foo\n"; }, bar => sub { print "$bar\n"; print Dumper \%hash }, ] );
To install pantheon, copy and paste the appropriate command in to your terminal.
cpanm
cpanm pantheon
CPAN shell
perl -MCPAN -e shell install pantheon
For more information on module installation, please visit the detailed CPAN module installation guide.