in reply to substr question
use strict; use warnings; my $s = "Hello, I am a perl/mysql programmer, but am self taught so I +do not know all the awesome features Perl has, however, I am ok at it + though, I guess."; my $s2; for (split /\s+/, $s) { $s2 .= "$_ "; last if length($s2) > 100; } print $s2; __END__ Hello, I am a perl/mysql programmer, but am self taught so I do not kn +ow all the awesome features Perl
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: substr question
by jwkrahn (Abbot) on Jun 18, 2010 at 18:45 UTC | |
by toolic (Bishop) on Jun 18, 2010 at 18:55 UTC |