But what if you need to access the new item after adding it?
27 weaken( $O{ $item }->[ $num_items ] );
Perl has a special notation for accessing the last item in an array:
weaken( $O{ $item }->[ -1 ] );