This is not really a perl question and more of an OS question but I'll give it go. On Linux, you can use the file command to identify file contents. When used on a binary executable, it will tell you the architecture of an executable.
$ file /bin/arch
/bin/arch: ELF 64-bit LSB executable, AMD x86-64, version 1 (SYSV), for GNU/Linux 2.6.9, dynamically linked (uses shared libs), stripped
$ file /bin/unicode_start
/bin/unicode_start: Bourne shell script text executable
$ file /bin/view
/bin/view: symbolic link to `vi'
I don't have access to a Solaris box but I know that the file command does exist there so that might be a good starting point.