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

This node falls below the community's minimum standard of quality and will not be displayed.

Replies are listed 'Best First'.
Re: dynamic arrays
by marto (Cardinal) on Feb 09, 2007 at 12:22 UTC
Re: dynamic arrays
by holli (Abbot) on Feb 09, 2007 at 13:32 UTC
    According to wikipedia a dynamic array is
    ... an array which is automatically expanded to accommodate new objects if filled beyond its current size. It may also automatically deallocate some of its unused space to save memory. It has become a popular data structure in modern mainstream programming languages, supplied with most standard libraries.
    In Perl all arrays are dynamic, because it's built into the language. The question is how do you create static arrays in perl? ;-)


    holli, /regexed monk/
Re: dynamic arrays
by chakram88 (Pilgrim) on Feb 09, 2007 at 12:28 UTC
    Welcome poojapo1.

    TIMTOWTDI

    You're going to have to give us a more detailed description of what it is you're trying to achieve.

    There are several posts regarding how to ask a question to get a better answer. Check out ybiC's home node for a complete listing.

    Do you have any code showing what you've attemted to do, that isn't working? If so, show it here, it's much easier to help you if you help us.

    Check out this tutorial: Perl Data Structures Cookbook, perhaps you'll find some answers there. Also, bookmark that site, it'll be very handy

Re: dynamic arrays
by fenLisesi (Priest) on Feb 09, 2007 at 14:20 UTC
    You may be interested in anonymous arrays. perlreftut may help. Cheers.

      What does an anonymous array provide that a named array does not, in this case?

        I agree that it looks like a stupid post. Well, ok, it is a stupid post. holli had already explained that Perl arrays are magical beasts. I figured the OP might be trying to ask for something like a dynamically allocated nameless piece of memory. While an anonymous array is not exactly that, since it is at least born nameless, it may better give the impression of fitting the mallocy world view of a newbie (such as myself). I hope to be back from my pilgrimage in time for the baptism.