Subject: | Advantage of do {} over just () in ::Service |
In App::Nopaste::Service, there is this block of code
$mech->submit_form(
fields => {
paste => $args{text},
do { $args{chan} ? (channel => $args{chan}) : () },
do { $args{desc} ? (summary => $args{desc}) : () },
do { $args{nick} ? (nick => $args{nick}) : () },
private => (exists $args{private} && $args{private} ? 1 : 0),
},
);
I am curious what the advantage of do {} is over simply wrapping with ()'s
ie.
( $args{chan} ? (channel => $args{chan}) : () ),
Cheers