Thread string nach jeder 4000 Stelle ein TAB einsetzten
(29 answers)
Opened by mr-sansibar at 2007-08-02 13:42 Code (perl): (dl
)
1 2 3 4 5 6 7 8 9 10 11 my $len = length($tmp_line); my $pos = 0; my $tab = 5; while ( my $s = unpack("x$pos A4000", $tmp_line) ) { $tab--; print $frontend "$s\t"; $pos += 4000; last if $pos >= $len; } print $frontend "\t" x $tab; print $frontend "\n"; What is a good module? That's hard to say.
What is good code? That's also hard to say. One man's Thing of Beauty is another's man's Evil Hack. |