Skip Menu |
Report information
Id: 116419
Status: open
Priority: 0/
Queue: perl6

Owner: Nobody
Requestors: kevin [at]

Severity: (no value)
Tag: Todo
Platform: (no value)
Patch Status: (no value)
VM: (no value)

Subject: Perl6 features out of date
Date: Wed, 16 Jan 2013 13:55:31 +0000
To: rakudobug [...]
From: kevin dawson <kevin [...]>
Download data_blocks.p6
text/plain 218b

Message body is not shown because sender requested not to inline it.

Hi All,

ticket as requested by FROGGS

the info in ->

relating to Lexing and Parsing - Pod implies all works,

But This is not the case

Data Blocks from -

Data blocks

Named Pod blocks whose typename is data are the Perl 6 equivalent of the Perl 5 __DATA__ section. The difference is that =data blocks are just regular Pod blocks and may appear anywhere within a source file, and as many times as required.

There is a corresponding variable, $=data, from which each =data block can be retrieved. $=data holds an object that does both the Associative and Positional roles.

Each =data block can be given a :key option, to name it. The contents of any =data block with a key are accessible (as a single string) via the Associative aspect of $=data object. For example:

    =begin data :key<Virtues>
    =end data

    say 'The three virtues are:';
    say $=data<Virtues>;

The contents of any =data block that does not have a :key are accessible (as a single string) via the Positional aspect of $=data. Unkeyed =data blocks are stored in the same order they appear in the file. For example:

    say 'The second anti_Virtue is: ', $=data[1];

    =data Industry
    =data Patience
    =data Humility

Note that, as the preceding example illustrates, because Pod is a compile-time phenomenon, it is possible to specify =data blocks after the point in the source where their contents will be used (provided they're not being used in a BEGIN, of course).

When $=data itself is stringified, it returns the concatenation of all the unkeyed =data blocks the parser has seen.

=data blocks are never rendered by the standard Pod renderers.

We Now Generate the following Output:

$ perl6 data_blocks.p6
Variable $=data is not declared
at data_blocks.p6:10
------> say $=data<Virtues>⏏;
    expecting any of:


Download (untitled) / with headers
text/plain 241b "status" : "r+ n+- (parsing only, no $=pod)", could be changed to "status" : "r+- n+- (parsing only, no $=pod)", regards or data blocks don't live in S26 I don't know
Download (untitled) / with headers
text/plain 138b
I'll modify the feature matrix at to reflect the missing implementation of $=data for Pod data blocks.

This service is sponsored and maintained by Best Practical Solutions and runs on infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at