in reply to Alternative to substr on unknown length of scalar
si_lenceuse strict; use warnings; my @lines = ( "??????????????", "123" ); my $conv; for my $line ( @lines ){ $conv=""; my @c = split('', $line); $conv .= ($c[$_] || 0) for 0..5; print "$conv\n"; }
|
|---|