develooper Front page | perl.perl6.users | Postings from July 2017

ping TImo: buf as a print

Thread Next
From:
ToddAndMargo
Date:
July 9, 2017 05:32
Subject:
ping TImo: buf as a print
Message ID:
2af1cbc8-46c2-4aa4-7511-9e264b76a6e3@zoho.com
On 07/08/2017 02:58 AM, timo wrote:
> @ToddAndMargo <https://github.com/toddandmargo > here's how to create an email with attachments:
> 
> my $image = "P5\n64 64\n255\n".encode("utf8") ~ Buf[int8].new( do for 
> -32..^32 X -32..^32 -> ($x, $y) { 255 - (sqrt($x ** 2 + $y ** 2) * 4 % 
> 255).ceiling });

Hi Timo,

perl6 -e 'my $image = "P5\n64 64\n255\n".encode("utf8") ~ Buf[int8].new(
 >     do for -32..^32 X -32..^32 -> ($x, $y) {
 >         255 - (sqrt($x ** 2 + $y ** 2) * 4 % 255).ceiling
 >     }); print $image;'

Cannot use a Buf as a string, but you called the Str method on it
   in block <unit> at -e line 4


Am I missing something?

-T

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About