in reply to Alternative to substr on unknown length of scalar

Hi,
I don't know if this classifies as more elegant than your solution ..
use 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"; }
si_lence