Probably better as:
my $s2; for ( split /(\s+)/, $s ) { last if length( $s2 . $_ ) > 100; $s2 .= $_; } print $s2;
In reply to Re^2: substr question
by jwkrahn
in thread substr question
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |