Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
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 about the Monastery: (2)
As of 2014-09-24 01:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (244 votes), past polls