As laalto said, Blowfish_PP (because it's Blowfish, not because it's _PP) is working on blocks.
Dealing with it is usually complex, that's why you have Crypt::CBC module which is a wrapper on (virtually) any Crypt::* module that provides block cipher, and allows you to use it in a much simpler way.
For example, your code with Crypt::CBC would be:
#!/usr/bin/perl -w
use strict;
use Crypt::CBC;
my $key = "12345678";
my $plaintextBlock = "mystringhere";
my $cipher = Crypt::CBC->new(
-key => $key,
-cipher => 'Blowfish_PP'
);
my $ciphertext = $cipher->encrypt($plaintextBlock);
# my $textual = $ciphertext;
# $textual =~ s/([^a-zA-Z0-9])/sprintf "\\x%02x", ord $1/ge;
# print "ciphertext: [$textual]\n";
print "ciphertext: [$ciphertext]\n";
my $plaintext = $cipher->decrypt($ciphertext);
print "plaintext: [$plaintext]\n";
Remember that ciphertext is stream of bytes, so it's not really printable. You might want to unhash 3 lines in the code (starting with my $textual = $ciphertext) to show the ciphertext in a bit more readable way.
Additional benefit of using Crypt::CBC is that if you'll ever want to switch to another algorithm - it's just one change in Crypt::CBC->new() call.
By the way - why Crypt::Blowfish_PP ? I mean, why not Crypt::Blowfish? _PP version is generally simply slower.
Additional note, straight from Crypt::Blowfish, which we can assume to be functionally equivalent to Crypt::Blowfish_PP:
The module is capable of being used
with Crypt::CBC. You’re encouraged to
read the perldoc for Crypt::CBC if you
intend to use this module for Cipher
Block Chaining modes. In fact, if you
have any intentions of encrypting more
than eight bytes of data with this, or
any other block cipher, you’re going
to need some type of block chaining
help. Crypt::CBC tends to be very
good at this. If you’re not going to
encrypt more than eight bytes, your
data must be exactly eight bytes long.
If need be, do your own padding. "\0"
as a null byte is perfectly valid to
use for this.