From: minima Date: Fri, 23 Mar 2001 00:38:50 +0000 (+0000) Subject: find problem in split in print_all_fields X-Git-Tag: R_1_47~95 X-Git-Url: http://dxcluster.net/gitweb/gitweb.cgi?a=commitdiff_plain;h=7af6a50c04cf10adb387b92dba43e51b78eb949c;p=spider.git find problem in split in print_all_fields --- diff --git a/perl/DXUtil.pm b/perl/DXUtil.pm index 2e8a5284..0b3de951 100644 --- a/perl/DXUtil.pm +++ b/perl/DXUtil.pm @@ -183,12 +183,13 @@ sub print_all_fields my ($priv, $ans) = promptf($ref->field_prompt($field), $ref->{$field}); my @tmp; if (length $ans > 79) { - my ($p, $a) = split /: /, $ans; + my ($p, $a) = split /: /, $ans, 2; my $l = (length $p) + 2; my $al = 79 - $l; + my $bit; while (length $a > $al ) { - $a =~ s/^(.{$al})//; - push @tmp, "$p: $1"; + ($bit, $a) = unpack "A$al A*", $a; + push @tmp, "$p: $bit"; $p = ' ' x ($l - 2); } push @tmp, "$p: $a" if length $a;