| Data-CPAN-DSLIP-Explain documentation | Contained in the Data-CPAN-DSLIP-Explain distribution. |
Data::CPAN::DSLIP::Explain - "decrypts" CPAN module DSLIP code
use strict;
use warnings;
use Data::CPAN::DSLIP::Explain;
my $dslip = 'Sdcfp';
my $obj = Data::CPAN::DSLIP::Explain->new;
my $meaning = $obj->dslip( $dslip );
print "\nDSLIP code `$dslip` means:\n",
join "\n\t",
map {
$obj->explain_dslip_letter( $_ )
. "\n\t\t$meaning->{$_}"
} qw(D S L I P);
print "\n\n----\n";
The module explains the DSLIP codes for those of us who have bad memory. DSLIP stands for Development Stage, Support Level, Language Used, Interface Style, Public License. DSLIP codes is what'd you'd see in CPAN module list.
my $object = Data::CPAN::DSLIP::Explain->new;
Creates and returns a new Data::CPAN::DSLIP::Explain object. Takes no arguments.
my $meaning = $object->dslip( 'Sdcfp' );
my @meanings = $object->dslip( qw( Sdcfp Sdcfp Sdcfp ) );
$VAR1 = {
'D' => 'Standard, supplied with Perl',
'S' => 'Developer',
'L' => 'C and perl, a C compiler will be needed'
'I' => 'plain Functions, no references used',
'P' => 'Standard-Perl: user may choose between GPL and Artistic',
};
Takes one or more arguments which should be DSLIP codes. In scalar context returns the meaning of the first DSLIP in a form of a hashref. In list context returns a list of explanations for one or several DSLIP code passed as arguments. The meaning is a hashref with keys being each of the letters of DSLIP:
Will contain Development Stage of the module.
Will contain Support Level of the module.
Will contain module's Language Used.
Will contain description of module's Interface Style.
Will contain module's Public License type.
my $D_means = $object->explain_dslip_letter('D');
my $S_means = $object->explain_dslip_letter('S');
my $L_means = $object->explain_dslip_letter('L');
my $I_means = $object->explain_dslip_letter('I');
my $P_means = $object->explain_dslip_letter('P');
Takes one argument which is a letter of DSLIP acronym and returns an
explaination of what that letter stands for. In other words
$object->explain_dslip_letter('S'); would return Support Level.
Zoffix Znet, <zoffix at cpan.org>
Please report any bugs or feature requests to bug-data-cpan-dslip-explain at rt.cpan.org, or through
the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Data-CPAN-DSLIP-Explain. I will be notified, and then you'll
automatically be notified of progress on your bug as I make changes.
You can find documentation for this module with the perldoc command.
perldoc Data::CPAN::DSLIP::Explain
You can also look for information at:
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Data-CPAN-DSLIP-Explain
Copyright 2008 Zoffix Znet, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
| Data-CPAN-DSLIP-Explain documentation | Contained in the Data-CPAN-DSLIP-Explain distribution. |
package Data::CPAN::DSLIP::Explain; use warnings; use strict; our $VERSION = '0.03'; use Carp; sub new { my $class = shift; croak "Must have even number of arguments to ->new()" if @_ & 1; my %args = @_; $args{ lc $_ } = delete $args{ $_ } for keys %args; return bless \%args, $class; } sub dslip { my $self = shift; my $dslip = $self->_convert_dslip( @_ ); if ( wantarray ) { return @$dslip; } else { return $dslip->[0]; } } sub _convert_dslip { my $self = shift; my @dslips = @_; my $explanation_of = $self->_get_dslip_explanations; my @result; foreach my $dslip ( @dslips ) { my %codes; @codes{ qw(D S L I P) } = map { lc } split //, $dslip; $codes{ $_ } = $explanation_of->{ $_ }{ $codes{$_} } for keys %codes; push @result, \%codes; } return \@result; } sub explain_dslip_letter { my $self = shift; my $dslip_letter = uc shift; my $explanation_of = $self->_get_dslip_explanations; return $explanation_of->{ $dslip_letter }{info}; } sub _get_dslip_explanations { my $self = shift; return { D => { info => 'Development Stage (Note: *NO IMPLIED TIMESCALES*)', i => 'Idea, listed to gain consensus or as a placeholder', c => 'under construction but pre-alpha (not yet released)', a => 'Alpha testing', b => 'Beta testing', r => 'Released', 'm' => 'Mature (no rigorous definition)', 's' => 'Standard, supplied with Perl', }, S => { info => 'Support Level', 'm' => 'Mailing-list', d => 'Developer', u => 'Usenet newsgroup comp.lang.perl.modules', n => 'None known, try comp.lang.perl.modules', }, L => { info => 'Language Used', p => 'Perl-only, no compiler needed, ' . 'should be platform independent', c => 'C and perl, a C compiler will be needed', h => 'written in perl with optional C code, ' . 'no compiler needed', '+' => 'C++ and perl, a C++ compiler will be needed', o => 'perl and another language other than C or C++', }, I => { info => 'Interface Style', f => 'plain Functions, no references used', h => 'hybrid, object and function interfaces available', n => 'no interface at all (huh?)', r => 'some use of unblessed References or ties', o => 'Object oriented using blessed references ' . 'and/or inheritance', }, P => { info => 'Public License', p => 'Standard-Perl: user may choose between GPL ' . 'and Artistic', g => 'GPL: GNU General Public License', l => 'LGPL: "GNU Lesser General Public License"' . '(previously known as "GNU Library ' . 'General Public License")', b => 'BSD: The BSD License', a => 'Artistic license alone', o => 'other (but distribution allowed ' . 'without restrictions)', } } } 1; __END__