in reply to Re^2: do $n exist in grep?
in thread do $n exist in grep?
I use a similar idiom in formulating a return responses or external calls, sometimes:
my ($stdout, $stderr, $ret) = capture { system('foo', ($somearg ? ('--somearg' => $somearg ) : ()), ($otherarg ? ('--otherarg' => $otherarg) : ()), ); };
...or...
return { status => $s, ($optional_field ? (optional_field => $optional_field) : ()), };
Caveat emptor. The need to do either of these may constitute code smell, but sometimes purity has to give way to get it done-ery.
Dave
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: do $n exist in grep?
by choroba (Cardinal) on May 12, 2021 at 17:02 UTC | |
by davido (Cardinal) on May 12, 2021 at 17:26 UTC | |
|
Re^4: do $n exist in grep?
by Marshall (Canon) on May 12, 2021 at 20:46 UTC |