2009/11/25 Steve Bertrand <st...@ibctech.ca>: > Steve Bertrand wrote: >> Hi all, >> >> I just upgraded from perl 5.8 to perl 5.10.1. Everything went well, >> except for a single module that I need. >> >> The offending code is this: >> >> ${$self->{__pb_template_list}}[...@{$self->{__PB__TEMPLATE_LIST}}}]->param( >> $param, $value ); >> >> As I understand it, $# has been deprecated in 5.10. Can someone please >> help me understand the above line of code? What does $# represent in >> this context? > > Well, I finally trudged through it. In order to make it work: > > my $elem = �...@{ $self->{__PB_TEMPLATE_LIST} }; > $elem--; > ${$self->{__PB_TEMPLATE_LIST}}[$elem]->param( $param, $value ); > > Not the most elegant solution, but it works for now!
Wouldn't this work? ${$self->{__PB_TEMPLATE_LIST}}[$#{$self->{__PB_TEMPLATE_LIST} }]->param( $param, $value ); Originally you had $...@{$foo}} which doesn't make sense to me. If $foo is an arrayref then to get the index of the last element of the array referent you use $#{$foo}. Philip -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/