Right. In real code, I'd simply do my first choice in the opening description.
However, the idea of declaring a variable and having a reference to it immediately
is a fun idiom. I used it earlier in template for using bind_columns with DBI, for example.