Ten modules I haven't yet talked about
Upcoming SlideShare
Loading in...5
×
 

Ten modules I haven't yet talked about

on

  • 2,827 views

I have 77 modules on the CPAN and I haven't

I have 77 modules on the CPAN and I haven't
yet given a talk about most of them. I'll pick ten
useful but less-known modules of mine and give two
minute introductions to each

Statistics

Views

Total Views
2,827
Views on SlideShare
2,824
Embed Views
3

Actions

Likes
2
Downloads
2
Comments
0

1 Embed 3

http://www.slideshare.net 3

Accessibility

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Ten modules I haven't yet talked about Ten modules I haven't yet talked about Presentation Transcript

  • Ten modules I haven’t yet talked about I have modules on the CPAN and I haven’t yet given a talk about most of them. I’ll pick ten useful but less-known modules of mine and give two minute introductions to each. Léon Brocard London Perl Workshop
  • Me Léon Brocard French, live in London Like food Like the colour orange Founded Amsterdam.pm, Bath.pm, Croydon.pm Now in London.pm Started YAPC::Europe Perl hacker
  • distributions on the CPAN Acme-Buffy, Acme-Colour, App-Cache, Archive-Peek, Catalyst-Plugin-CookiedSession, Catalyst-Plugin-SimpleAuth, Compress-LZF_PP, Compress-LZMA-External, CPAN-IndexPod, CPAN-Metadata-RDF, CPAN-Mini-Webserver, CPAN-Unpack, Crypt-Skip32-Base32Crockford, Crypt-Skip32-Base64URLSafe, Data-Page, Data-UUID-Base64URLSafe, DateTime-Stringify, Devel-ebug, Devel-ebug-HTTP, Devel-Profit, Email-Send-Gandi, Email-Send-Gmail, File-Copy-Reliable, Fir, Games-GuessWord, Git-PurePerl, GraphViz, Haul, HTML-Fraction, HTML-TagCloud, HTTP-Server-Simple-Kwiki, Image-Imlib2, Image-Imlib2-Thumbnail, Image-Imlib2-Thumbnail-S3, Image-WorldMap, Java-JVM-Classfile, JSON-XS-VersionOneAndTwo, Kasago, Language-Functional, Mac-EyeTV, MealMaster, Messaging-Courier, Module-CPANTS-Generator, Module-Packaged, MP3-ID3Lib, Net-Amazon-S3, Net-Amazon-SimpleQueue, Net-DPAP-Client, Net-FTP-Throttle, Net-Mosso-CloudFiles, Net-OpenDHT, Net-Stomp, Net-VNC, Number-DataRate, OpenFrame-Segment-Apache, OpenFrame-Segment-Apache2, Parse-BACKPAN-Packages, Parse-CPAN-Authors, Parse-CPAN-Packages, Perl-Metric-Basic, PPIx-IndexOffsets, PPIx-LineToSub, Search-Mousse, String-Koremutake, Template-Plugin-Page, Template-Stash-Strict, Term-ProgressBar-Quiet, Test-Expect, Test-WWW-Mechanize-Catalyst, Tie-GHash, Tree-Ternary_XS, TV-Anytime, WWW-Gazetteer, WWW-Gazetteer-FallingRain, WWW-Gazetteer-Getty, WWW-Mechanize-Timed, WWW-Search-Google
  • Let’s pick ten App-Cache, Data-UUID-Base64URLSafe Crypt::Skip32::Base32Crockford, Email-Send-Gmail, Games-GuessWord, HTML-Fraction, Image-Imlib2-Thumbnail, Image-WorldMap, Net-FTP-Throttle, String-Koremutake, Term-ProgressBar-Quiet Term-ProgressBar-Simple.
  • App-Cache Easy application-level caching # in your class, stores in something like # ~/.parse_backpan_packages/cache/ my $cache = App::Cache->new({ ttl => 60*60 }); $cache->delete(’test’); my $data = $cache->get(’test’); my $code = $cache->get_code(quot;codequot;, sub { $self->calculate() }); my $html = $cache->get_url( quot;http://www.google.com/quot;); $cache->set(’test’, ’one’); $cache->set(’test’, { foo => ’bar’ }); my $scratch = $cache->scratch; $cache->clear;
  • App-Cache # in CPAN::Mini::Webserver my $cache = App::Cache->new( { ttl => 60 * 60 } ); my $parse_cpan_authors = $cache->get_code( ’parse_cpan_authors’, sub { Parse::CPAN::Authors->new( $authors_filename->stringify ) } );
  • Crypt::Skip ::Base Crockford Crypt::Skip + Encode::Base ::Crockford = database record IDs in URLs my $key = pack( ’H20’, quot;112233445566778899AAquot; ); my $cipher = Crypt::Skip32::Base32Crockford->new($key); my $n = 3493209676; my $b32 = $cipher->encrypt_number_b32_crockford($n); # 1PT4W80 my $m = $cipher->decrypt_number_b32_crockford($b32); # 3493209676
  • Email-Send-Gmail Send Messages using Gmail use Email::Send; use Email::Send::Gmail; use Email::Simple::Creator; my $email = Email::Simple->create( header => [ From => ’magicmonitoring@gmail.com’, To => ’acme@astray.com’, Subject => ’Server down’, ], body => ’The server is down, panic!’, );
  • Email-Send-Gmail my $sender = Email::Send->new( { mailer => ’Gmail’, mailer _args => [ username => ’magicmonitoring@gmail.com’, password => ’XXXISABADPASSWORD’, ] } ); eval { $sender->send($email) }; die quot;Error sending email: $@quot; if $@;
  • Games-GuessWord Guess the letters in a word (i. e. Hangman) my $g = Games::GuessWord->new( file => quot;/path/to/wordlistquot; ); print quot;Score: quot; . $g->score . quot;nquot;; print quot;Chances: quot; . $g->chances . quot;nquot;; print quot;Answer: quot; . $g->answer . quot;nquot;; my @guesses = $g->guesses; $g->guess(quot;tquot;); # ... if ($g->won) { print quot;You won!nquot;; $g->new_word; }
  • HTML-Fraction Encode fractions as HTML entities my $fraction = HTML::Fraction->new; print $fraction->tweak($html); # 1/5 is ⅕ which is displayed as ⁄
  • Image-Imlib - umbnail Generate a set of thumbnails of an image my $t = Image::Imlib2::Thumbnail->new(); foreach my $thumbnail ($t->generate( $image, $directory )) { my $name = $thumbnail->{name}; my $width= $thumbnail->{width}; my $height = $thumbnail->{height}; my $type = $thumbnail->{type}; my $filename = $thumbnail->{filename}; print quot;$name/$type is $width x $heightquot;; print quot; at $filenamenquot;; }
  • Image-Imlib - umbnail By default it generates thumbnails of the same dimension that Flickr generates: Type Name Width Height Landscape Square 75 75 Landscape Thumbnail 100 75 Landscape Small 240 180 Landscape Medium 500 375 Landscape Large 1024 768 Portrait Square 75 75 Portrait Thumbnail 75 100 Portrait Small 180 240 Portrait Medium 375 500 Portrait Large 768 1024
  • Image-WorldMap Create graphical world maps of data use Image::WorldMap; my $map = Image::WorldMap->new( quot;earth-small.pngquot;, quot;maian/8quot; ); $map->add(4.91, 52.35, quot;Amsterdam.pmquot;); $map->add(-2.355399, 51.3828, quot;Bath.pmquot;); $map->add(-0.093999, 51.3627, quot;Croydon.pmquot;); $map->draw(quot;test.pngquot;);
  • Image-WorldMap CPAN Mirrors
  • Net-FTP- rottle rottle FTP connections my $ftp = Net::FTP::Throttle->new( quot;ftp.example.comquot;, MegabitsPerSecond => 2 ) or die quot;Cannot connect: $@quot;; # then as with Net::FTP
  • String-Koremutake Convert to/from Koremutake Memorable Random Strings use String::Koremutake; my $k = String::Koremutake->new; my $s = $k->integer_to_koremutake(65535); # botretre my $i = $k->koremutake_to_integer(’koremutake’); # 10610353957
  • Term-ProgressBar-Simple Edmund extended my Term-ProgressBar-Quiet: provides a simple progress meter if run interactively use Term::ProgressBar::Simple; my @todo = ( (’x’) x 10 ); my $progress = Term::ProgressBar::Quiet->new( scalar(@todo), ); foreach my $todo (@todo) { # do something with $todo $progress++; } $progress->message(’All done’);
  • Term-ProgressBar-Quiet progress: 10% [=== ]0m06s Left progress: 40% [========== ]0m04s Left All done progress: 100% [==================]D 0h00m10s
  • anks Any questions?