#!/usr/bin/perl -w
# ###################################################################### #
# file:        base64_stringencode.pl v1.0                               #
# purpose:     tests encoding/decoding strings with base64               #
# author:      02/23/2009 Frank4DD                                       #
#                                                                        #
# This program encodes and decodes a sample string with base64 format.   #
# ########################################################################
use MIME::Base64;

$mysrc = "My bonnie is over the          ";
$myb64 = "";
$mydst = "";

$myb64 = encode_base64($mysrc);
chomp $myb64;

printf("The string\n[%s]\nencodes into base64 as:\n[%s]\n", $mysrc, $myb64);
printf("\n");

$mydst = decode_base64($myb64);
printf("The string\n[%s]\ndecodes from base64 as:\n[%s]\n", $myb64, $mydst);

exit 0;
