Acme-Be-Modern
view release on metacpan or search on metacpan
use Module::Build;
my $builder = Module::Build->new(
module_name => 'Acme::Be::Modern',
license => 'gpl3',
create_license => 1,
dist_author => q{Søren Lund <soren@lund.org>},
dist_version_from => 'lib/Acme/Be/Modern.pm',
requires => {
'Filter::Util::Call' => 0,
'Modern::Perl' => 0,
},
build_requires => {
'Test::More' => 0,
'Module::Loaded' => 0,
'Test::CheckManifest' => 0
},
configure_requires => {
'Module::Build' => 0.38,
'Software::License' => 0,
},
},
"configure" : {
"requires" : {
"Module::Build" : "0.38",
"Software::License" : "0"
}
},
"runtime" : {
"requires" : {
"Filter::Util::Call" : "0",
"Modern::Perl" : "0"
}
}
},
"provides" : {
"Acme::Be::Modern" : {
"file" : "lib/Acme/Be/Modern.pm",
"version" : "0.04"
}
},
"release_status" : "stable",
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
version: '1.4'
name: Acme-Be-Modern
provides:
Acme::Be::Modern:
file: lib/Acme/Be/Modern.pm
version: '0.04'
requires:
Filter::Util::Call: '0'
Modern::Perl: '0'
resources:
bugtracker: https://github.com/soren/Acme-Be-Modern/issues
license: http://www.gnu.org/licenses/gpl-3.0.txt
repository: https://github.com/soren/Acme-Be-Modern/
version: '0.04'
x_serialization_backend: 'CPAN::Meta::YAML version 0.018'
Makefile.PL view on Meta::CPAN
# Note: this file was auto-generated by Module::Build::Compat version 0.4229
use ExtUtils::MakeMaker;
WriteMakefile
(
'PREREQ_PM' => {
'Module::Loaded' => 0,
'Test::More' => 0,
'Modern::Perl' => 0,
'Test::CheckManifest' => 0,
'Filter::Util::Call' => 0
},
'INSTALLDIRS' => 'site',
'EXE_FILES' => [],
'PL_FILES' => {},
'NAME' => 'Acme::Be::Modern',
'VERSION_FROM' => 'lib/Acme/Be/Modern.pm'
)
;
Acme-Be-Modern
This is a source filter that enables you to write 'be modern' instead
of 'use Modern::Perl'. In other words you can replace one line (17
characters) with two lines (31 characters), and at the same time make
you program less stable. All this for free!
INSTALLATION
To install this module, run the following commands:
perl Build.PL
./Build
./Build test
lib/Acme/Be/Modern.pm view on Meta::CPAN
package Acme::Be::Modern;
use Modern::Perl;
use Filter::Util::Call;
=encoding utf-8
=head1 NAME
Acme::Be::Modern - enables your script to "be modern"
=head1 VERSION
lib/Acme/Be/Modern.pm view on Meta::CPAN
Version 0.04
=cut
our $VERSION = '0.04';
=head1 SYNOPSIS
This is a thin (and stupid) wrapper (actually a source filter) around
L<Modern::Perl>. It makes it possible to write 'be modern' instead of
'use Modern::Perl' - like this:
use Acme::Be::Modern;
be modern; # all lowercase is actually postmodern :-/
...
=cut
=head1 WARNING
lib/Acme/Be/Modern.pm view on Meta::CPAN
my ($type) = @_;
my ($ref) = [];
filter_add(bless $ref);
}
=head2 filter
The actual filter. Will receive source lines by calling
filter_read(). Any occurrence (and I mean any) of 'be modern' will be
replace with 'use Modern::Perl'.
=cut
sub filter {
my ($self) = @_;
my ($status);
s/be modern/use Modern::Perl/g if ($status = filter_read()) > 0;
$status;
}
=head1 AUTHOR
Søren Lund, C<< <slu at cpan.org> >>
=head1 BUGS
Yes! This is buggy. It's a source filter, and it's really stupid. Any
text in your source matching 'be modern' will be replaced with 'use
Modern::Perl'.
Please report any bugs or feature requests to C<bug-acme-be-modern at rt.cpan.org>, or through
the web interface at L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Acme-Be-Modern>. I will be notified, and then you'll
automatically be notified of progress on your bug as I make changes.
=head1 SUPPORT
You can find documentation for this module with the perldoc command.
perldoc Acme::Be::Modern
t/be-modern.t view on Meta::CPAN
use Test::More tests => 1;
use Module::Loaded;
use Acme::Be::Modern;
be modern;
ok(is_loaded('Modern::Perl'));
( run in 0.526 second using v1.01-cache-2.11-cpan-a5abf4f5562 )