En Perl, los ındices negativos cuentan desde el final del array
(-1 es el último elemento).
DB<1> @a = 1..10
DB<2> $a[-1] = 1
DB<3> p "@a"
1 2 3 4 5 6 7 8 9 1
DB<4> $a[-20] = 0
Modification of non-creatable array value attempted,
subscript -20 at (eval 18)
[/usr/share/perl/5.6.1/perl5db.pl:1521] line 2.
DB<5> p $#a
9
Casiano Rodríguez León

Principios de Programación Imperativa, Funcional y Orientada a Objetos Una Introducción en Perl/Una Introducción a Perl
por Casiano Rodríguez León
is licensed under a Creative Commons Reconocimiento 3.0 Unported License.
Permissions beyond the scope of this license may be available at http://campusvirtual.ull.es/ocw/course/view.php?id=43.
2012-06-19