In the following in Perl script:
$a=apple $b=orange if ($?==0) { # do something }
What does $? mean here?
$?
$?, along with all the other "magic" variables, is documented in the perlvar section of the Perl manpages. If you don't actually have a Unix-like setup with the man command, you should also be able to Google for man perlvar.
perlvar
man
man perlvar