Is this the same

In:
http://www.perl.com/pub/doc/manual/html/pod/perldata.html
I think I read the following.

Is $row[-1] the same then $#row??

I tried it without success!

Michel
mmcwAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
amandeepConnect With a Mentor Commented:
mmcw,

- $row[-1] means the value of the last element in the arrar @row.
- $#row means the last element number of the array @row.

Hence :

print $row[-1];

and

print $row[$#row];

would give the same result.

Hope this helps.
:-)
0
All Courses

From novice to tech pro — start learning today.