my @args; my %chkopts = ( help => $help, b => $backup, u => $upd_sybase, s => $silent, ); while (my ($k, $v) = each %chkopts) { next unless defined $v; push @args, $v ? "--$k" : "--no$k"; } my %chkargs = ( update => $update, server => $server, user => $user, password => $password, ); while (my ($k, $v) = each %chkargs) { next unless defined $v; push @args "$k=$v"; }