Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Perl print "$("

Tags:

perl

I'm just starting to learn Perl, and I (accidentally) came across this print behavior I can't explain. If I do:

print "$(";

the result I get is:

1000 4 20 24 25 27 29 30 44 46 117 1000 1001
like image 908
Ronald Wildenberg Avatar asked Feb 25 '26 01:02

Ronald Wildenberg


1 Answers

That is known as a Special Variable. From perldoc perlvar:

$REAL_GROUP_ID
$GID
$(

The real gid of this process. If you are on a machine that supports membership in multiple groups simultaneously, gives a space separated list of groups you are in. The first number is the one returned by getgid(), and the subsequent ones by getgroups(), one of which may be the same as the first number.

etc.

like image 61
toolic Avatar answered Feb 26 '26 19:02

toolic



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!