cmdline doesn't exist in Solaris /proc. Proc-ProcessTable does the trick on several platforms:
use strict;
use warnings;
use Proc::ProcessTable;
my $proc_table = Proc::ProcessTable->new->table;
my ($process) = grep { $_->pid == $$ } @$proc_table;
print $process->cmndline, "\n";