Pluto - Functional Programming
Functional Scripting for Perl 5
package Cosmos; use Pluto; call(string('hello world'), 'titlecase'); # Hello World
This package enables functional programming for Perl 5 via indirect routine dispatching and dependency injection, operating in a way that plays nicely with third-party libraries without having to switch over to object-oriented programming.
Perl is a multi-paradigm programming language that supports functional programming, but, Perl has an intentionally limited standard library with an emphasis on providing library support via the CPAN which is overwhelmingly object-oriented. This makes developing in a functional style difficult as you'll eventually need to rely on a CPAN library that requires you to switch over to object-oriented programming.
This package uses type constraints from:
Types::Standard
This package supports the following scenarios:
# given: synopsis array;
This package supports making the array function available in the calling package if it doesn't exist already. This function creates a Data::Object::Array object.
array
# given: synopsis bool;
This package supports making the bool function available in the calling package if it doesn't exist already. This function creates a Data::Object::Boolean object.
bool
# given: synopsis call('Test', 'ok');
This package supports making the call function available in the calling package. This function dispatches function and method calls to a package.
call
# given: synopsis code;
This package supports making the code function available in the calling package if it doesn't exist already. This function creates a Data::Object::Code object.
code
# given: synopsis false;
This package supports making the false function available in the calling package if it doesn't exist already. This function creates a Data::Object::Boolean object.
false
# given: synopsis float;
This package supports making the float function available in the)calling package if it doesn't exist already. This function creates a Data::Object::Float object.
float
# given: synopsis hash;
This package supports making the hash function available in the)calling package if it doesn't exist already. This function creates a Data::Object::Hash object.
hash
# given: synopsis number;
This package supports making the number function available in the)calling package if it doesn't exist already. This function creates a Data::Object::Number object.
number
# given: synopsis regexp;
This package supports making the regexp function available in the)calling package if it doesn't exist already. This function creates a Data::Object::Regexp object.
regexp
# given: synopsis space;
This package supports making the space function available in the)calling package if it doesn't exist already. This function creates a Data::Object::Space object.
space
# given: synopsis string;
This package supports making the string function available in the)calling package if it doesn't exist already. This function creates a Data::Object::String object.
string
# given: synopsis true;
This package supports making the true function available in the)calling package if it doesn't exist already. This function creates a Data::Object::Boolean object.
true
Al Newkirk, awncorp@cpan.org
awncorp@cpan.org
Copyright (C) 2011-2019, Al Newkirk, et al.
This is free software; you can redistribute it and/or modify it under the terms of the The Apache License, Version 2.0, as elucidated in the "license file".
Wiki
Project
Initiatives
Milestones
Contributing
Issues
To install Pluto, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Pluto
CPAN shell
perl -MCPAN -e shell install Pluto
For more information on module installation, please visit the detailed CPAN module installation guide.