Re: Workaround for Perl 5's __DATA__

2016-01-18 Thread Tom Browder
On Mon, Jan 18, 2016 at 6:47 AM, Kamil Kułaga  wrote:
> You may be happy with =finish block
...

Thanks, Kamil!

-Tom


Re: Workaround for Perl 5's __DATA__

2016-01-18 Thread Kamil Kułaga
You may be happy with =finish block

use v6;

say $=finish.split("\n").perl;


=finish
_
I like pancakes
And apples

On Sat, Jan 16, 2016 at 8:07 PM, Tom Browder  wrote:
> I have tried this in my Perl 6 code (v6.c):
>
> =begin DATA
> blah
> blah2
> =end DATA
>
> Then:
>
> for $=DATA.lines -> $line {
>   # process a line
> }
>
> but I get this message:
>
> Pod variable @=DATA not yet implemented. Sorry.
>
> Is there any workaround for this other than putting the data in an array?
>
> Thanks.
>
> Best regards,
>
> -Tom



-- 
Pozdrawiam

Kamil Kułaga


Workaround for Perl 5's __DATA__

2016-01-16 Thread Tom Browder
I have tried this in my Perl 6 code (v6.c):

=begin DATA
blah
blah2
=end DATA

Then:

for $=DATA.lines -> $line {
  # process a line
}

but I get this message:

Pod variable @=DATA not yet implemented. Sorry.

Is there any workaround for this other than putting the data in an array?

Thanks.

Best regards,

-Tom