#!/usr/bin/perl # We need the Base64, encode_base64 function exactly use MIME::Base64 qw(decode_base64); use strict; sub process_stdin{ while(){ chomp($_); print decode_base64("$_")."\n"; } return 0; } sub process_arguments{ foreach my $cad (@ARGV){ print decode_base64("$cad")."\n"; } return 0; } ###### # main ###### my $numargs = $#ARGV + 1; if (( $numargs == 0 ) or ( $numargs == 1 and $ARGV[0] eq "-")) { process_stdin; }else{ process_arguments; } exit 0;