Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

Re: Concatenating Array elements

by muba (Priest)
on Aug 19, 2014 at 20:39 UTC ( #1098044=note: print w/replies, xml ) Need Help??

in reply to Concatenating Array elements

Your code will only modify the value of $array[7] (which was 8: remember that array indexes start at 0, not at 1). In other words, after $array[7] = $array[7] + $array[8], your array will contain (1, 2, 3, 4, 5, 6, 7, "89", 9, 10).

The index of the element with value 9 is still 8 as it has always been (again, array indexes start at 0, not at 1). No elements have been moved around or deleted. Only the 8th element (the one with index 7) has been altered.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1098044]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (8)
As of 2019-04-23 16:00 GMT
Find Nodes?
    Voting Booth?
    I am most likely to install a new module from CPAN if:

    Results (118 votes). Check out past polls.