Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

My book doens't cover this very well so I had to make an attempt at unshift(@numbers) = "0"; hoping that would add the number zero to the beginning of my array. Of course it doesn't work, but can someone give me the real way to do it?

Replies are listed 'Best First'.
•Re: unshifting an array
by merlyn (Sage) on Jan 24, 2004 at 14:32 UTC
Re: unshifting an array
by sulfericacid (Deacon) on Jan 24, 2004 at 14:33 UTC
     unshift(@numbers, "0"); I believe is the way you do it. It follows the same pattern as push.


    "Age is nothing more than an inaccurate number bestowed upon us at birth as just another means for others to judge and classify us"

    sulfericacid