In Perl, do $>
and $?
have special meaning in the same way that $_
and @_
are "special"?
Yes, there are many special variables whose name is a single punctuation character, including the scalar variable >
(written $>
) and the scalar variable ?
(written $?
). They are documented in perldoc perlvar
.
$>
is the process's effective user ID. It's “magical” in that assigning to it will change the EUID (if permitted).
$?
contains the status of the last external process call. It's a little magical (e.g. you can only assign integers to it), but mainly several built-in constructs (such as backticks, i.e. `foo`
) assign to it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With