Well, that's obviously true on your system. But not necessarily everywhere: getpwnam() returns whatever the underlying
library call returns, so man getpwnam is your reference there.
Actually, on systems where the underlying getpwnam() never returns the crypted password but Perl knows how to get the crypted password, Perl's getpwnam() will return the crypted password when you are root. Some like this, some hate it. But you are right in that it doesn't work on all systems.