in reply to Re^2: how to shorten given string?
in thread how to shorten given string?
Yes, but why? It works fine, but substr is quicker and easier to understand.
my $short = ( m/^(.{1,20})/ ) ? $1 : '';
...or...
my( $short ) = m/^(.{0,20})/;
Dave
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: how to shorten given string?
by bart (Canon) on Oct 14, 2004 at 01:57 UTC | |
by davido (Cardinal) on Oct 14, 2004 at 03:08 UTC | |
by bart (Canon) on Oct 14, 2004 at 03:12 UTC |