in reply to Regex help
If all you want to do is trim the string to be 1100 characters at most, just do this:
update: As a later reply points out, the length test is not necessary. If you don't want to do the test, at least point out WHY it is that you're calling substr.use constant MAX_CHARS => 1100; if ( length($str) > MAX_CHARS ) { $str = substr( $str, 0, MAX_CHARS ); }
# Limit the string's length $str = substr( $str, 0, MAX_CHARS );
xoxo,
Andy
%_=split/;/,".;;n;u;e;ot;t;her;c; ". # Andy Lester
'Perl ;@; a;a;j;m;er;y;t;p;n;d;s;o;'. # http://petdance.com
"hack";print map delete$_{$_},split//,q< andy@petdance.com >
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Regex help
by MeowChow (Vicar) on Jun 15, 2001 at 20:46 UTC |