- or download this
use strict;
use warnings;
...
print "$combined\n";
__END__
a=1 c=1
- or download this
'if ( $a ) { $combined .= "a=$a " }'
- or download this
my $template = 'if ( $%s ) { $combined .= "%s=$%s " }';
eval sprintf $template, $_, $_, $_ for qw( a b c );
- or download this
'$combined .= "%s=$%s " if $%s'
- or download this
'$%s and $combined .= "%s=$%s "'