Changeset 9553 for lib

Show
Ignore:
Timestamp:
03/14/06 02:49:11 (3 years ago)
Author:
arathorn
Message:

explanation of why use v6-pugs works from $Larry

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lib/v6.pm

    r9384 r9553  
    4646    no v6; 
    4747 
     48=head1 NOTES 
     49 
     50Whilst resembling C<use VERSION> syntax, Perl 5 actually (mis)interprets 
     51C<use v6-pugs> as a request to use a module named C<v6.pm>, passing in C<'-pugs'> 
     52as an argument list to C<import> after C<v6.pm> is C<require>d.  No whitespace 
     53is required between the module name and the argument list in this instance 
     54because of the bizarre interaction between the hybrid C<use VERSION> and 
     55C<use Module VERSION> syntax. 
     56 
     57Larry gave the following explanation of why it works on C<#perl6>: 
     58 
     59    ...the interaction of v-syntax with 'use' versions is interesting, to say 
     60    the least, as witnessed by 'v6-pugs'. 
     61 
     62    In theory, Perl 5 oughta just blow up the moment it sees a 'use v6', saying  
     63    "I'm not version 6..." But there's chicanery in the lexer to rearrange  
     64    module versions, such that the parser sees the version first, and that's  
     65    getting fooled by 'v6-pugs' into thinking it's a module version when the  
     66    parser thinks otherwise. 
     67 
    4868=head1 SEE ALSO 
    4969