in reply to unix $? problem

What shell are you using? I almost get what you describe from csh and tcsh but the shell stops interpreting commands once it gets an error. It never executes the final echo $?.
0 /Users/john 0 csh: HA: Undefined variable.

When Perl executes a one-argument system command and the string contains shell metacharacters like ;, it runs the command by passing it to sh -c. I don't see any documented way to change this.

However, you could use
system ("csh","-c","echo \$?; echo \$PWD; echo \$?; echo \$HA; echo \$ +\?");
or whatever your shell is.