Skip to content

Instantly share code, notes, and snippets.

@axtl
Created July 16, 2013 06:04
Show Gist options
  • Save axtl/6006157 to your computer and use it in GitHub Desktop.
Save axtl/6006157 to your computer and use it in GitHub Desktop.
Thin CLI wrapper around [Email::Enkoder](https://github.com/wchristian/email-enkoder).
#!/usr/bin/env perl
use strict;
use warnings;
use Email::Enkoder;
my $email = $ARGV[0];
my $text = $ARGV[1] ? $ARGV[1] : "email";
my $subject = $ARGV[2] ? $ARGV[2] : "";
chomp ($email);
chomp ($text);
chomp ($subject);
my $enkoded = Email::Enkoder::enkode_mail(
$email,
{
max_length => 1,
# enkoders => $enkoders,
link_text => qq|$text|,
link_attributes => qq|title="$email" class="$email"|,
subject => $subject
}
);
print $enkoded;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment