Why print $ (gives a series of numbers

When I started with variables, print the variable $foo in the line

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 type $( 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?

+7
perl
source share
2 answers

$( = The reality of this process.

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

$) = Effectively evaluate this process.

$] = Perlversion

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

+10
source share

See perldoc perlvar (in fact, see it anytime you have a $ question followed by a character).

$( and $) provide real and effective process guides.

You get a list of highlighted spaces if the system supports membership in several groups at the same time.

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

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

+7
source share

All Articles