I really really wonder how you can think that
can be prettier thanfunc( aa => (my $aa = foo()), bb => (my $bb = bar()), );
One can argue code aesthetics all day, but your assignment can be a real pain in the long run and all it does is to fool the maintenance programmer into thinking that you especially want those values later. If you do this, although please don't, at least use a do block to handle the scoping issue (and make the maintenance programmer scratch his head a little less).func( aa => scalar foo(), bb => scalar bar(), );
func( aa => do { my $t = foo() }, bb => do { my $t = bar() }, );
ihb
Read argumentation in its context!
In reply to Re^5: how to force scalar context (without scalar())?
by ihb
in thread how to force scalar context (without scalar())?
by borisz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |