Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Perl print "$("

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

Here’s a nice screenshot.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

enter image description here

Probably makes total sense for someone who knows Perl, so if anyone can enlighten me, highly appreciated.

>Solution :

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.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading