On Sat, 23 Nov 2002, Jonathan M. Hollin wrote:
Can anyone offer me some pointers (pun intended) on how to implement a
stack in Perl with an array?
The description you give does not describe an 'academic' stack...
You would probably need to read some good Perl books. I suggest
the classical
Jonathan M. Hollin wrote to [EMAIL PROTECTED]:
Can anyone offer me some pointers (pun intended) on how to implement
a stack in Perl with an array?
Perl has two simple builtin functions for treating an array like a
stack. See push() and pop().
Basically:
my @stack;
push @stack, e3;
push
Tim Tompkins wrote to Ben Mathews:
Honestly, I didn't see where any of those libs would assist what the
poster wanted to accomplish. What's wrong with splice?
For implementing a traditional stack, the splice operation (or any
operation which has to rearrange the list every time an element is
But push()ing and pop()ing is not what the original poster wants to do. He
wants to splice(). It doesn't matter if he's talking about treating a stack
in the traditional sense, and it doesn't matter that splice is not as
efficient as push or pop. What matters is that he knows how to accomplish
Tim Tompkins wrote:
But push()ing and pop()ing is not what the original poster wants to do. He
wants to splice(). It doesn't matter if he's talking about treating a stack
in the traditional sense, and it doesn't matter that splice is not as
efficient as push or pop. What matters is that he
Don't reinvent the wheel.
http://search.cpan.org/search?query=stackmode=module
Ben
-Original Message-
From: Jonathan M. Hollin [mailto:[EMAIL PROTECTED]]
Sent: Saturday, November 23, 2002 6:59 AM
To: [EMAIL PROTECTED]
Subject: [OT] Stack Operation
Can anyone offer me some
Honestly, I didn't see where any of those libs would assist what the
poster wanted to accomplish. What's wrong with splice?
--
Tim
On Sat, 2002-11-23 at 09:03, Ben Mathews wrote:
Don't reinvent the wheel.
http://search.cpan.org/search?query=stackmode=module
Ben
-Original