| 1 | package Acme::BeCool; | ||||||||||
| 2 | |||||||||||
| 3 | =head1 NAME | ||||||||||
| 4 | |||||||||||
| 5 | Acme::BeCool -- Make your modules use the modules that get you some. | ||||||||||
| 6 | |||||||||||
| 7 | =head1 SYNOPSIS | ||||||||||
| 8 | |||||||||||
| 9 | use Acme::BeCool; # Wakka-chikka, wakka-chikka... | ||||||||||
| 10 | |||||||||||
| 11 | # Whatever you write here will get play. | ||||||||||
| 12 | |||||||||||
| 13 | or | ||||||||||
| 14 | |||||||||||
| 15 | use Acme::BeCool qw(This That And The::Other); # I *define* cool. | ||||||||||
| 16 | # really? | ||||||||||
| 17 | |||||||||||
| 18 | =cut | ||||||||||
| 19 | |||||||||||
| 20 | # This improves my Kwalitee? | ||||||||||
| 21 | 1 | q# | |||||||||
| 22 | use strict; | ||||||||||
| 23 | use warnings; | ||||||||||
| 24 | #; | ||||||||||
| 25 | |||||||||||
| 26 | 1 | $VERSION = '0.02'; | |||||||||
| 27 | |||||||||||
| 28 | 1 | ▶ | use LWP::Simple; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 29 | |||||||||||
| 30 | sub import | ||||||||||
| 31 | 1 | ▶ | { | ||||||||
|
Subroutine
import: called CC=5 SCAR=18.1
| |||||||||||
| 32 | 1 | shift; | |||||||||
| 33 | 1 | ▶ | if (!@_) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 34 | 1 | my $page = get 'http://search.cpan.org/search?query=cool&mode=all'; | |||||||||
| 35 | 1 | ▶ | push @_, $1 while $page =~ m!<h2.*?<b>(.*?)</b></a></h2>!g; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 36 | } | ||||||||||
| 37 | 1 | @_ = grep !/\//, @_; | |||||||||
| 38 | 1 | my $caller = shift; | |||||||||
| 39 | 1 | my $cool = 0; | |||||||||
| 40 | 1 | for (@_) { | |||||||||
| 41 | 0 | eval "require $_"; | |||||||||
| 42 | 0 | ▶ | $caller->import($_) unless $@; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 43 | } | ||||||||||
| 44 | 1 | print STDERR "You are ", ($cool / @_), "\% cool\n"; | |||||||||
| 45 | } | ||||||||||
| 46 | |||||||||||
| 47 | 1 | 1; | |||||||||
| 48 | __END__ | ||||||||||