Ten(-ish) minutes for Boston.PM Virtual

I said I could probably talk for ten minutes; let's see if I even get that far…

Set::Tiny

Set::Tiny

A lightweight “set” class. It's all stuff you can do with hashes yourself, but it's handy to have.

use Set::Tiny 'set';

my $set1 = set(qw(a b c d));
my $set2 = set([qw(a b c d)]);
my $set3 = set($set2);

Email::Stuffer

Email::Stuffer

It makes it easy to send email.

use Email::Stuffer;

my $email = Email::Stuffer
  ->from($from)
  ->to($to)
  ->subject($subject)
  ->text_body($body)
  ->send_or_die();

Or, if you want attachments:

use Email::Stuffer;

my $email = Email::Stuffer
  ->from($from)
  ->to($to)
  ->subject($subject)
  ->text_body($body);

foreach my $a (@$attach) {
	$email->attach( $a->{'body'}, $a->{'headers'}->@* );
}

$email->send_or_die();

It also supports html_body().

Text::CSV_XS

Text::CSV_XS

There is a new (to me, at least) option to provide key[key] and value[value] parameters.

my $variables = csv(
	in       => $dictionary_path,
	encoding => "UTF-8",
	key      => 'varname',
	value    => [ 'formname', 'type', 'options' ],
);

Also, be careful about BOMs. Although the documentation says they can be handled, I couldn't get that to work.

Fin