in reply to suffix arrays
A reference to substr's return value has the properties you want,
That the reference is to the original string is shown by:my $foo = "A string to work on."; my @substrs = map {\substr $foo, $_} 0 .. length($foo) - 1; my @sorted = sort { $$a cmp $$b } @substrs;
$ perl -e '$foo = "A short string\n"; $bar = \substr $foo, 0, 1; $$bar + = "The"; print $foo' The short string $
After Compline,
Zaxo
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: suffix arrays
by BrowserUk (Patriarch) on Jul 18, 2003 at 21:17 UTC | |
by Zaxo (Archbishop) on Jul 18, 2003 at 21:53 UTC | |
by BrowserUk (Patriarch) on Jul 18, 2003 at 22:13 UTC |