Skip to content

Instantly share code, notes, and snippets.

@s-aska
Created March 28, 2011 05:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save s-aska/890039 to your computer and use it in GitHub Desktop.
Save s-aska/890039 to your computer and use it in GitHub Desktop.
base64
#!/usr/bin/env perl
use strict;
use MIME::Base64;
my $base64 = encode_base64(join('', <>));
$base64=~s|\s*||g;
print $base64, "\n";
# base64
# ~/bin/base64.pl ~/Downloads/button-only.gif
# HTML
# <img src="data:image/gif;base64,XXXXXXXXXX">
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment