Christian Stalp <[EMAIL PROTECTED]> asked:
> I need a Tipp how I can create a linked ring-list in Perl. I 
> know well that arrays in Perl are already realized as linked 
> list, but what I need is a ring-list. Means that at the last 
> element owns a reference to the first element. 
> 
> Has anybody an idea how to make it?

You can roll your own linked list implementation using array or
hash references to maintain linkage.

If you're not afarid to write a small module, you can use tie to
extend a normal Perl list to a circular list.

Or if you're lazy you can go to search.cpan.org and see wether
somebody else already wrote some code that does what you need ;-)

http://search.cpan.org/~millaway/Tie-Scalar-RingBuffer-0.04/RingBuffer.pm

HTH,
Thomas

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to