What are you're doing doesn't look good for me. You can do the same much simpler:
my @buffer; sub store { return "Buffer is full" if @buffer >= 4; push @buffer, $_[0]; } sub retrieve { shift @buffer; }
Update: ikegami is right, if you have reader and writer threads ring buffer is quite useful. And my code would require some synchronization.
In reply to Re: Linked lists in an array of hashes
by zwon
in thread Linked lists in an array of hashes
by biohisham
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |