perl - What happens when you put an array on the right side of a => operator? -


It may look like a stupid question but it's been a long day. I'm optimizing some Perl code for another use and I ran on this syntax:

  my @request; # ... Fill the array with the content ... my $ answer = $ service-> Call ('Request Message' = & gt; @ Request, $ Title);  

This method is impossible to call, if = & gt; is only a special type of comma and the @ request list is launched in the list.

Is it really equivalent to this:

  My $ answer = $ service-> Call ('Request Message' = & gt; \ @ Request, $ Header);  

What's going on here?

Edit: Thanks for the answer I know very well about the difference between value and near distance from context. I was asking that the price was being converted from one clear pass reference to one pass. apparently not. thanks for answering. Code in question:

  My $ answer = $ service-   

is not equal to:

  my $ answer = $ service-> gt; ; Call ('requestMessage' = & gt; \ @ request, $ title);  

It is, as you would guess, equals:

  my $ answer = $ service-> Call ('requestMessage', @request, $ header);  

Sometimes, "fat comma", such as => is known to be used to indicate the relation between the positional norms. For example, the link between the method name some_method and the desired code to this code:

  $ server-> Distribution_across_node (some_method = & gt; @gridges);  

Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

php - Multiple Select with Explode: only returns the word "Array" -

php - jQuery AJAX Post not working -