You didn't say much about your version of Solaris, but I would let compiler availability dictate which direction to take. A full-featured compiler used to be a costly add-on for Solaris (then again Solaris didn't used to be FOSS!). I'm thinking that since you appear to have gcc installed already, I'd build perl from source using gcc.
In my experience Blowfish can be tough to build and has a lot of dependencies that can also be tricky - other Crypt modules, SHA-1, etc. The more complete your development environment the better luck you'll have negotiating all of those builds. Since the Sun package may not be readily available, gcc may be your best bet, but there are still other factors to consider. Do you need to deploy this on other machines? Do those machines have development tools, etc.?