Damian Conway wrote:
> Raiph elucidated:
>> I was thinking it would be possible to reference (compiler) variables
>> representing eg. the name and sig of a block being parsed, or a block
>> or declaration which has just been parsed, or which is just about to be
>> parsed, and that simply referencing these variables would be ok and
>> would save the need to create explicit named anchors.
>
> Well, that certainly *is* possible in Pod, which will definitely have
> access to any compile-time
> Perl variables, including the following usually bits of information:
>
>    $?FILE      Which file am I in?
>    $?LINE      Which line am I at?
>    &?ROUTINE   Which routine am I in?
>    &?BLOCK     Which block am I in?
>    $?SCOPE     Which lexical scope am I in?
>    $?PACKAGE   Which package am I in?
>    $?MODULE    Which module am I in?
>    $?CLASS     Which class am I in? (as variable)
>    $?ROLE      Which role am I in? (as variable)
>    $?GRAMMAR   Which grammar am I in?

Huh.  Would you be able to do something like:

    =begin pod
    Welcome to $?FILE.

...and have it interpolate the file's name?  Or would you need some
special markup for this, such as:

    =begin pod
    Welcome to A<$?FILE>.

Or would you have to alias the variable and then refer to it?

-- 
Jonathan "Dataweaver" Lang

Reply via email to