http://www.perlmonks.org?node_id=208551


in reply to •Re: multiple method calls against the same object (f.ex GUI programming)
in thread multiple method calls against the same object (f.ex GUI programming)

I know about the first, but it wasn't possible here and also turns ugly when you have a multilevel call somewhere in that pile.

I was actually thinking the second is as good as I can do in this case. What I didn't like about topicalizing with a for in that case is that for one, I still have to mention the object for every method call, although at least it's only $_ now. And worse yet, I still need a temporary variable for every widget, even when it's a widget I don't care about having access to later (scrollbars often fall in this category f.ex).

By rearranging the program to use this snippet I managed to throw away about 4 out of 5 of my variables. That's more than a little win in clarity in my book.

But thanks for the suggestions. :-)

Makeshifts last the longest.