Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic

Re: Dereferencing and context?

by The Mad Hatter (Priest)
on Feb 08, 2004 at 18:18 UTC ( #327488=note: print w/ replies, xml ) Need Help??

in reply to Dereferencing and context?

I don't see why you would have expected the same output.

In the second example, $_ is an array ref and when you dereference it is an array (for all purposes here). Since you're concatenating to a string, it has to be a scalar value, and the scalar value of an array is the number of elements in that array. In the first example, you explicitly concatenate the elements of both arrays.

The difference is that in the first you are concatenating elements, and in the second you are concatenating the scalar values of two arrays.

Comment on Re: Dereferencing and context?

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (6)
As of 2015-12-01 01:22 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (791 votes), past polls