$final_fragments{$final_fragment2} = $third_fragments[scalar @third_fragments - 1]; #### $final_fragments{$final_fragment2} = $third_fragments[@third_fragments - 1]; #### $final_fragments{$final_fragment2} = $third_fragments[$#third_fragments]; #### $final_fragments{$final_fragment2} = $third_fragments[-1]; #### roboticus@sparky:~$ cat t.pl #!/usr/bin/perl use strict; use warnings; my @foo = (5, 7, 9, 11, 13); print $foo[scalar @foo - 1], "\n"; print $foo[@foo - 1], "\n"; print $foo[$#foo], "\n"; print $foo[-1], "\n"; print $foo[-2], "\n"; print $foo[-3], "\n"; roboticus@sparky:~$ perl t.pl 13 13 13 13 11 9 roboticus@sparky:~$