note
LanX
you could use the [doc://perlop#Conditional-Operator|conditional operator] aka "ternary operator" :<P>
<c>my @cell_contents = map { $_ ? 1 : 0 } @$array_ref[3..10];</c><P>
another idea is to use doubled negation "<c>!!</c>" and to map the empty string (false) to 0.<P>
<c>my @cell_contents = map { 0 + !!$_ } @$array_ref[3..10];</c><P>
but I don't think this conciseness justifies the loss of readability.¹<P>
<!-- Node text goes above. Div tags should contain sig only -->
<div class="pmsig"><div class="pmsig-708738">
<p>Cheers Rolf
</div></div><P>
¹) well if you really need 0 for false.
1010917
1010917