Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: how many lines returned from backticks

by Aristotle (Chancellor)
on Jun 30, 2002 at 10:33 UTC ( #178348=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://178348]
help
Chatterbox?
marto should develop the 'anti-social network'
[marto]: sign up to make it impossible to be contacted online :P
[Discipulus]: karl: configuring the network is like: nmcli conn add con-name "name name" ifname eth0 type eterneth.... not so different from powersehell longness

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (8)
As of 2017-12-14 11:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What programming language do you hate the most?




















    Results (389 votes). Check out past polls.

    Notices?