That funny syntax represents the index of the last element of an array starting from 0, eg:
#!/usr/bin/perl use warnings; use strict; my @a = qw(0 1 2 3 4 5); print "$#a\n\n"; for my $i (0 .. $#a){ print "$i\n"; } print "elem 5: $a[$#a]\n"; # same as $a[-1] or $a[5]
Output:
5 0 1 2 3 4 5 elem 5: 5
-stevieb
In reply to Re: strange syntax
by stevieb
in thread strange syntax
by grasshopper!!!
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |