Appropriately, non-root users cannot read the shadow file, so your setuid script is a good idea.
Unfortunately, Solaris will not honor setuid bits on scripts. You can demonstrate this with a perl script:
Perl:
#!/usr/bin/perl
use POSIX qw(geteuid);
print "$0 is running as ".geteuid()."\n";
unlink "testfile-created-by-$0";
open(fh,">testfile");
close(fh);
and then run the script like this
$ id -u
1000
$ chmod 755 test-script.pl
$ ./test-script.pl
./test-script.pl is running as 1000
$ sudo chown root:root test-script.pl
$ sudo chmod 5755 test-script.pl
$ ./test-script.pl
./test-script.pl is running as 1000
So what to do then? One easy solution would be to actually run the perl script as root, using sudo or via the root user's crontab.
Another solution would be to add the user who will run this script to the group who owns /etc/shadow like so
usermod -a -G shadow yourusernamehere