http://www.perlmonks.org?node_id=178348


in reply to how many lines returned from backticks

If the program returned 5 lines the first time, and only 2 the next, won't there be lines left over from the first time?

Actually, despite what others here may have said, you do not have to worry about anything. Unlike traditional languages, an array in Perl is not just a name for a series of consecutive memory addresses (just like scalars are not just names for single memory addresses); it is a smart data type (again, scalars are too) which may grow and shrink, moving about in memory as circumstances demand etc. It does what traditional languages require you to implement linked lists for, and more.

The whole point of this explanation:
my @a=(1,2,3,4,5); @a=(1,2,3); print "@a\n"; =output 1 2 3
Perl does the nitty gritty of keeping things clean for you. Garbage collection, undef, references being smart unlike pointers, and so and so forth..

Makeshifts last the longest.

Replies are listed 'Best First'.
Re: Re: how many lines returned from backticks
by jdpindynet (Initiate) on Jul 02, 2002 at 22:48 UTC
    Many thanks to all who answered, especially Aristotle.

    The knave has now lost one measure of knaveness, thanks to the wisdom of the monks.

    jdpindynet