Here's an interesting tip: use Perl's wonderful and favorite testing modules for debugging. This will not only give you the opportunity to start testing, but sometimes they will significantly speed up the debugging process. For instance:
#!/usr/bin/perl use strict; use warnings; use Test::More 0.88; BEGIN { use_ok 'MIME::Base64' => qw(encode_base64) } is( encode_base64("test", "dGVzdA==", q{"test" encodes okay} ); done_testing;
Run the script with perl or with prove , and it will not just tell you that it does not match, it will say:
# Failed test '"test" encodes okay'
# at testbase64.pl line 6.
# got: 'gGVzdA ==
# '
# expected: 'dGVzdA =='
and readers with sharp eyes will notice that the difference between them is indeed a new line. :)
source share