What does a dollar sign followed by a question mark mean in Perl?

前端 未结 4 1892
萌比男神i
萌比男神i 2021-01-11 23:06

In the following in Perl script:

$a=apple
$b=orange

if ($?==0) {
  # do something
}

What does $? mean here?

4条回答
  •  既然无缘
    2021-01-11 23:37

    Others have answered the question about the meaning of $?.

    I thought I would also mention that it is also possible to get help on Perl's special variables at the command prompt:

    perldoc -v $?
    

    Depending on your shell, you may need to escape the $.

    perldoc -h

提交回复
热议问题