Beefy Boxes and Bandwidth Generously Provided by pair Networks vroom
Think about Loose Coupling
 
PerlMonks  

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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2014-04-19 08:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (478 votes), past polls