$> and $? to pearl

In Perl do $> and $? make special sense in the same way that $_ and @_ are "special"?

+4
source share
1 answer

Yes, there are many special variables whose name is one punctuation character, including the scalar variable > (written $> ) and the scalar variable ? (is it written $? ). They are described in perldoc perlvar .

$> is an effective user id. This is β€œmagical” in that the EUID will change its destination (if allowed).

$? contains the status of the last external call of the process. This is a little magical (for example, you can assign integers to it), but basically it has several built-in constructions (for example, reverse images, i.e. `foo` ).

+13
source

All Articles