#!/usr/local/bin/perl -w
#---------#---------#---------#---------#---------#---------#---------#---------
#
# title
#   read base64 encoded lines from STDIN, write unicode to STDOUT
# author
#   larg 16 mar 04
# description
#   LDIFs don't cope well with funny foreign writing.
#   translate LDIF lines from
#      description:: RnJhbudvaXMncyBtYXRl
#   to
#      description: François's mate
#
# modifications
#
#---------#---------#---------#---------#---------#---------#---------#---------
# setup
#   This is the cup of tea stage, useful for do a little sorting out before
#   getting down to some real work.

   use 5.005;
   use strict;
   use MIME::Base64;

#---------#---------#---------#---------#---------#---------#---------#---------
# main
#   The main program goes here.
    while (<>) {
        if (m/(\S+:):\s(\S+)/) {
            # it's a base64 encoded line. Decode and print.
            print "$1 ", decode_base64($2),"\n" ;
        } else {
            print;
        }
    }

#---------#---------#---------#---------#---------#---------#---------#---------

__END__

documentation

The "__END__" string is a token. It is the logical end of program text.
You can put anything you want after this token, such as an
instruction manual page; it will be ignored by the compiler.

