in reply to
How to remove the certain element of an object
Personally, I would reject the present purge_this_one subroutine in a code review. I’d do it because phrasing such as $_[n], while syntactically acceptable to Perl, most certainly is not informative to me, nor to anyone else who might encounter this code in the future. I’d have to examine each and every use of the subroutine in order to figure out either how to call it correctly or how to debug it.
Furthermore, the code is trusting. What if $idx is undefined (or whatever) because the element isn’t there at all? The code doesn’t work anymore, and it doesn’t say why it doesn’t.
Take the extra few microseconds it takes to write code that is legible, maintainable by someone other than yourself, and capable of responding at least with respect to the Hippocratic Oath if the program contains an error elsewhere. You will be very glad that you did.