why does printing $( gives a number series

Viewed 177

When I started with variables to print a variable $foo in a string

I used print ${foo}s but when I used print "$(foo)s" it gave me

1000 4 24 27 30 46 108 125 1000)s . When I printed $( or $) it gives me the sequence 1000 4 24 27 30 46 108 125 1000 . Also $[ gave 5.014002 and $] gave 0 . What do they mean?

2 Answers

$( = The real gid of this process.

$[ = This variable stores the index of the first element in an array, and of the first character in a substring. The default is 0.

$) = The effective gid of this process.

$] = Perlversion

seen here: http://perldoc.perl.org/perlvar.html

See perldoc perlvar (in fact, see it any time you have a question about $ followed by a symbol).

$( and $) give the real and effective gids of the process.

You get a space separated list of gids if the system supports membership in multiple groups simultaneously.

$[ is the index considered to be the first element of an array.

$] is an old way to get the version of Perl being used to run the program.

Related