in reply to Re: suffix arrays
in thread suffix arrays
Unfortunately, as of 5.8.0, that still doesn't work properly.
perl> print join "\n", map{ \substr 'The quick brown fox', $_ } 0 .. +19 LVALUE(0x15d7cf4) LVALUE(0x15d7cf4) LVALUE(0x15d7cf4) LVALUE(0x15d7cf4) LVALUE(0x15d7cf4) LVALUE(0x15d7cf4) LVALUE(0x15d7cf4) LVALUE(0x15d7cf4) LVALUE(0x15d7cf4) LVALUE(0x15d7cf4) LVALUE(0x15d7cf4) LVALUE(0x15d7cf4) LVALUE(0x15d7cf4) LVALUE(0x15d7cf4) LVALUE(0x15d7cf4) LVALUE(0x15d7cf4) LVALUE(0x15d7cf4) LVALUE(0x15d7cf4) LVALUE(0x15d7cf4) LVALUE(0x15d7cf4)
As you can see, each time you take an Lvalue from substr, it re-uses the same address. So you end up with and array of pointers to the last char in the string.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Re: suffix arrays
by Zaxo (Archbishop) on Jul 18, 2003 at 21:53 UTC | |
by BrowserUk (Patriarch) on Jul 18, 2003 at 22:13 UTC |