Changeset 23238

Show
Ignore:
Timestamp:
01/30/06 23:34:39 (3 years ago)
Author:
larry
Message:

Clarification of :p meaning.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • doc/trunk/design/syn/S06.pod

    r23235 r23238  
    1414  Maintainer: Larry Wall <larry@wall.org> 
    1515  Date: 21 Mar 2003 
    16   Last Modified: 20 Jan 2006 
     16  Last Modified: 30 Jan 2006 
    1717  Number: 6 
    18   Version: 13 
     18  Version: 14 
    1919 
    2020 
     
    357357    doit :b(%hash{'b'}),1,2,3; 
    358358 
    359 To pass pairs out of hash without their being interpreted as named 
    360 parameters, use 
     359Ordinary hash notation will just pass the value of the hash entry as a 
     360positional argument regardless of whether it is a pair or not. 
     361To pass both key and value out of hash as a positional pair, use C<:p>. 
    361362 
    362363    doit %hash<a>:p,1,2,3; 
    363364    doit %hash{'b'}:p,1,2,3; 
    364365 
    365 instead. 
     366instead..  (The C<:p> stands for "pairs", not "positional"--the 
     367C<:p> adverb may be placed on any hash reference to make it mean 
     368"pairs" instead of "values".) 
    366369 
    367370Pairs are recognized syntactically at the call level and mystically