Perl 6, losing your Perl 5 accent

Lance Wicks

»ö« Perl 6, Losing your Perl 5 Accent - Lance Wicks - LPW2019 🐪
»ö« Perl 6, Losing your Perl 5 Accent - Lance Wicks - LPW2019 🐪

introduction

  • Perl Developer
  • Perl 5 Developer
  • Perl 6 Developer (myjudo.net)
  • From Aotearoa (New Zealand)
  • I do 柔道  (Judo)
     
  • slides.com/lancewicks/lpw2019
  • slides.com/lancewicks/lpw2019/live
     
  • www.LanceWicks.com
  • lw@judocoach.com
»ö« Perl 6, Losing your Perl 5 Accent - Lance Wicks - LPW2019 🐪

Tēnā koutou, TĒNĀ KOUTOU, TĒNĀ KOUTOU katoa

»ö« Perl 6, Losing your Perl 5 Accent - Lance Wicks - LPW2019 🐪

Greetings, Greetings, greetings to you all

mĀori
IS A
language

»ö« Perl 6, Losing your Perl 5 Accent - Lance Wicks - LPW2019 🐪

Perl 5
IS A
language

»ö« Perl 6, Losing your Perl 5 Accent - Lance Wicks - LPW2019 🐪

Perl 6
is a
DIFFERENT
LANGUAGE

»ö« Perl 6, Losing your Perl 5 Accent - Lance Wicks - LPW2019 🐪

But unlike māori and english

»ö« Perl 6, Losing your Perl 5 Accent - Lance Wicks - LPW2019 🐪

I can speak both Perl languages

»ö« Perl 6, Losing your Perl 5 Accent - Lance Wicks - LPW2019 🐪

...but with a strong perl5 accent

»ö« Perl 6, Losing your Perl 5 Accent - Lance Wicks - LPW2019 🐪

perl 5
&
perl 6

»ö« Perl 6, Losing your Perl 5 Accent - Lance Wicks - LPW2019 🐪

AOTEAROA
&
rarotonga

»ö« Perl 6, Losing your Perl 5 Accent - Lance Wicks - LPW2019 🐪

MĀORI
&
MĀORI

»ö« Perl 6, Losing your Perl 5 Accent - Lance Wicks - LPW2019 🐪

"Moana"
New zealand
&
​cook islands

»ö« Perl 6, Losing your Perl 5 Accent - Lance Wicks - LPW2019 🐪

"Moana"
=
ocean

»ö« Perl 6, Losing your Perl 5 Accent - Lance Wicks - LPW2019 🐪

"Moana"
=
ocean

»ö« Perl 6, Losing your Perl 5 Accent - Lance Wicks - LPW2019 🐪
»ö« Perl 6, Losing your Perl 5 Accent - Lance Wicks - LPW2019 🐪
my $foo;
for (1..5) {
    $foo += $_;
}
print $foo;

perl 5

»ö« Perl 6, Losing your Perl 5 Accent - Lance Wicks - LPW2019 🐪
my $foo;
for (1..5) {
    $foo += $_;
}
print $foo;

perl 6

perl 5

perl 6

»ö« Perl 6, Losing your Perl 5 Accent - Lance Wicks - LPW2019 🐪

Māori

MĀORI

»ö« Perl 6, Losing your Perl 5 Accent - Lance Wicks - LPW2019 🐪
All human beings are born free and equal in dignity and rights. They are endowed with reason and conscience and should act towards one another in a spirit of brotherhood.
»ö« Perl 6, Losing your Perl 5 Accent - Lance Wicks - LPW2019 🐪
Ko te katoa o nga tangata i te whanaungatanga mai e watea ana i nga here katoa; e tauriterite ana hoki nga mana me nga tika. E whakawhiwhia ana hoki ki a ratou te ngakau whai whakaaro me te hinengaro mohio ki te tika me te he, a e tika ana kia meinga te mahi a tetahi ki tetahi me ma roto atu i te wairua o te noho tahi, ano he teina he tuakana i ringa i te whakaaro kotahi.
»ö« Perl 6, Losing your Perl 5 Accent - Lance Wicks - LPW2019 🐪
Kua anau rangatira ia te tangata katoatoa ma te aiteite i te au tikaanga e te tu ngateitei tiratiratu. Kua ki ia ratou e te mero kimi ravenga e te akavangakau e kia akono tetai i tetai, i roto i te vaerua piri anga taeake.
»ö« Perl 6, Losing your Perl 5 Accent - Lance Wicks - LPW2019 🐪
»ö« Perl 6, Losing your Perl 5 Accent - Lance Wicks - LPW2019 🐪
# Perl6 with Perl 5 accent
my $foo;
for (1..5) {
    $foo += $_;
}
print $foo;


# Perl 6
my $foo = [+] (1..5)
print $foo;

losing your

perl 5 accent

»ö« Perl 6, Losing your Perl 5 Accent - Lance Wicks - LPW2019 🐪
»ö« Perl 6, Losing your Perl 5 Accent - Lance Wicks - LPW2019 🐪
# Perl 5
sub area  {
    my %args = @_;

    return $args{height} * $args{width};
}

print area(height => 5, width => 5);


# output: 25
»ö« Perl 6, Losing your Perl 5 Accent - Lance Wicks - LPW2019 🐪
# Perl 6
sub area  {
    my %args = @_;

    return $args{height} * $args{width};
}

print area(height => 5, width => 5);


# output: 
#===SORRY!=== Error while compiling /home/lancew/dev/lpw/loops.p6
#Variable '$args' is not declared. Did you mean '%args'?
#at /home/lancew/dev/lpw/loops.p6:5
#------>     return 'yes' if ⏏$args{positive};
»ö« Perl 6, Losing your Perl 5 Accent - Lance Wicks - LPW2019 🐪
# Perl 6
sub area  {
    my %args = @_;

    return %args{'height'} * %args{'width'};
}

print area('height' => 5, 'width' => 5);


# output: 25
»ö« Perl 6, Losing your Perl 5 Accent - Lance Wicks - LPW2019 🐪
# Perl 6
sub area  {
    my %args = @_;

    return %args{'height'} * %args{'width'};
}

print area('height' => 5, 'width' => 5);


# output: 25
»ö« Perl 6, Losing your Perl 5 Accent - Lance Wicks - LPW2019 🐪
# Perl 6
sub area  {
    my %args = @_;

    return %args{'height'} * %args{'width'};
}

print area('height' => 5, 'width' => 5);


# output: 25
»ö« Perl 6, Losing your Perl 5 Accent - Lance Wicks - LPW2019 🐪
# Perl 6
sub area (:$height, :$width) {
    return $height * $width;
}

say area(:height(5), :width(5));

# output: 25
»ö« Perl 6, Losing your Perl 5 Accent - Lance Wicks - LPW2019 🐪
# Perl 6
sub area (:$height, :$width) {
    return $height * $width;
}

say area(:height(5), :width(5));

# output: 25
»ö« Perl 6, Losing your Perl 5 Accent - Lance Wicks - LPW2019 🐪
# Perl 6
sub area (:$height, :$width) {
    return $height * $width;
}

say area(:height(5), :width(5));

# output: 25
»ö« Perl 6, Losing your Perl 5 Accent - Lance Wicks - LPW2019 🐪
# Perl 6
sub area (:$height, :$width) {
    return $height * $width;
}

say area(:height(5), :width(5));

# output: 25
»ö« Perl 6, Losing your Perl 5 Accent - Lance Wicks - LPW2019 🐪
# Perl 6
sub area (Int :$height, Int :$width) returns Int {
    return $height * $width;
}

say area(:height("foo"), :5width);

# output:
# Type check failed in binding to parameter '$height'; 
# expected Int but got Str ("foo")
#   in sub area at loops.p6 line 2
#   in block <unit> at loops.p6 line 7
»ö« Perl 6, Losing your Perl 5 Accent - Lance Wicks - LPW2019 🐪
# Perl 6
sub area (Int :$height, Int :$width) returns Int {
    return $height * $width;
}

say area(:height("foo"), :5width);

# output:
# Type check failed in binding to parameter '$height'; 
# expected Int but got Str ("foo")
#   in sub area at loops.p6 line 2
#   in block <unit> at loops.p6 line 7
»ö« Perl 6, Losing your Perl 5 Accent - Lance Wicks - LPW2019 🐪
# Perl 6
sub area (Int :$height, Int :$width) returns Int {
    return $height * $width;
}

say area(:height("foo"), :5width);

# output:
# Type check failed in binding to parameter '$height'; 
# expected Int but got Str ("foo")
#   in sub area at loops.p6 line 2
#   in block <unit> at loops.p6 line 7
»ö« Perl 6, Losing your Perl 5 Accent - Lance Wicks - LPW2019 🐪
# Perl 6
sub area (Int :$height, Int :$width) returns Int {
    return $height * $width;
}

say area(:height("foo"), :5width);

# output:
# Type check failed in binding to parameter '$height'; 
# expected Int but got Str ("foo")
#   in sub area at loops.p6 line 2
#   in block <unit> at loops.p6 line 7
»ö« Perl 6, Losing your Perl 5 Accent - Lance Wicks - LPW2019 🐪
# Perl 6
sub area (Int :$height, Int :$width) returns Int {
    return $height * $width;
}

say area(:height("foo"), :5width);

# output:
# Type check failed in binding to parameter '$height'; 
# expected Int but got Str ("foo")
#   in sub area at loops.p6 line 2
#   in block <unit> at loops.p6 line 7

enter the weekly challenge

»ö« Perl 6, Losing your Perl 5 Accent - Lance Wicks - LPW2019 🐪
»ö« Perl 6, Losing your Perl 5 Accent - Lance Wicks - LPW2019 🐪
use strict;
use warnings;
use Function::Parameters;
use Data::Dumper;

die "Usage: ch-1.pl [N]\n" if @ARGV>1;
my $n = shift // 100;

my $percentleft = 100;
my $biggestpercent = 0;
my $guestwithbiggestpercent = 0;

foreach my $i (1..$n)
{
	my $pi = $i * $percentleft / 100;	# amount for guest i
	print "guest $i has $pi percent of the pie\n";
	if( $pi > $biggestpercent )
	{
		$biggestpercent = $pi;
		$guestwithbiggestpercent = $i;
	}
	$percentleft -= $pi;		# percentage left over
}

print "\nguest $guestwithbiggestpercent has biggest percentage of pie: ".
	"$biggestpercent\n";

#$ perl test2.pl 5
#guest 1 has 1 percent of the pie
#guest 2 has 1.98 percent of the pie
#guest 3 has 2.9106 percent of the pie
#guest 4 has 3.764376 percent of the pie
#guest 5 has 4.5172512 percent of the pie
#
#guest 5 has biggest percentage of pie: 4.5172512
»ö« Perl 6, Losing your Perl 5 Accent - Lance Wicks - LPW2019 🐪
sub MAIN(Int $n=100) {
	my $percentleft = 100;
	my $biggestpercent = 0;
	my $guestwithbiggestpercent = 0;

	for 1..$n -> $i
	{
		my $pi = $i * $percentleft / 100;	# amount for guest i
		say "guest $i has $pi percent of the pie";
		if $pi > $biggestpercent
		{
			$biggestpercent = $pi;
			$guestwithbiggestpercent = $i;
		}
		$percentleft -= $pi;		# percentage left over
	}

	say "\nguest $guestwithbiggestpercent has biggest percentage of pie: " ~
		"$biggestpercent";
}

# $perl6 test2.p6 5
#guest 1 has 1 percent of the pie
#guest 2 has 1.98 percent of the pie
#guest 3 has 2.9106 percent of the pie
#guest 4 has 3.764376 percent of the pie
#guest 5 has 4.5172512 percent of the pie
#
#guest 5 has biggest percentage of pie: 4.5172512
»ö« Perl 6, Losing your Perl 5 Accent - Lance Wicks - LPW2019 🐪
sub MAIN(Int $n=100) {
	my $percentleft = 100;
	my $biggestpercent = 0;
	my $guestwithbiggestpercent = 0;

	for 1..$n -> $i
	{
		my $pi = $i * $percentleft / 100;	# amount for guest i
		say "guest $i has $pi percent of the pie";
		if $pi > $biggestpercent
		{
			$biggestpercent = $pi;
			$guestwithbiggestpercent = $i;
		}
		$percentleft -= $pi;		# percentage left over
	}

	say "\nguest $guestwithbiggestpercent has biggest percentage of pie: " ~
		"$biggestpercent";
}

# $perl6 test2.p6 5
#guest 1 has 1 percent of the pie
#guest 2 has 1.98 percent of the pie
#guest 3 has 2.9106 percent of the pie
#guest 4 has 3.764376 percent of the pie
#guest 5 has 4.5172512 percent of the pie
#
#guest 5 has biggest percentage of pie: 4.5172512
»ö« Perl 6, Losing your Perl 5 Accent - Lance Wicks - LPW2019 🐪
sub MAIN(Int $n=100) {
	my $percentleft = 100;
	my $biggestpercent = 0;
	my $guestwithbiggestpercent = 0;

	for 1..$n -> $i
	{
		my $pi = $i * $percentleft / 100;	# amount for guest i
		say "guest $i has $pi percent of the pie";
		if $pi > $biggestpercent
		{
			$biggestpercent = $pi;
			$guestwithbiggestpercent = $i;
		}
		$percentleft -= $pi;		# percentage left over
	}

	say "\nguest $guestwithbiggestpercent has biggest percentage of pie: " ~
		"$biggestpercent";
}

# $perl6 test2.p6 5
#guest 1 has 1 percent of the pie
#guest 2 has 1.98 percent of the pie
#guest 3 has 2.9106 percent of the pie
#guest 4 has 3.764376 percent of the pie
#guest 5 has 4.5172512 percent of the pie
#
#guest 5 has biggest percentage of pie: 4.5172512
»ö« Perl 6, Losing your Perl 5 Accent - Lance Wicks - LPW2019 🐪
sub MAIN(Int $n=100) {
	my $percentleft = 100;
	my $biggestpercent = 0;
	my $guestwithbiggestpercent = 0;

	for 1..$n -> $i
	{
		my $pi = $i * $percentleft / 100;	# amount for guest i
		say "guest $i has $pi percent of the pie";
		if $pi > $biggestpercent
		{
			$biggestpercent = $pi;
			$guestwithbiggestpercent = $i;
		}
		$percentleft -= $pi;		# percentage left over
	}

	say "\nguest $guestwithbiggestpercent has biggest percentage of pie: " ~
		"$biggestpercent";
}

# $perl6 test2.p6 5
#guest 1 has 1 percent of the pie
#guest 2 has 1.98 percent of the pie
#guest 3 has 2.9106 percent of the pie
#guest 4 has 3.764376 percent of the pie
#guest 5 has 4.5172512 percent of the pie
#
#guest 5 has biggest percentage of pie: 4.5172512
»ö« Perl 6, Losing your Perl 5 Accent - Lance Wicks - LPW2019 🐪

TIMTOWTDI

»ö« Perl 6, Losing your Perl 5 Accent - Lance Wicks - LPW2019 🐪
sub MAIN(Int $n=100) {
  my ($topguest, $topshare) = (1 .. $n).map({
        state $pie = 100.0;
        my $share = $pie * ($_ * 0.01);
        $pie -= $share;

        $_ => $share;
    })
    .max( *.value )
    .kv;

  say "Guest $topguest gets ",  $topshare, '% of the pie.';
}

# $perl6 test2_map.p6 5
#
# Guest 5 gets 4.5172512% of the pie.

»ö« Perl 6, Losing your Perl 5 Accent - Lance Wicks - LPW2019 🐪
sub MAIN(Int $n=100) {
  my ($topguest, $topshare) = (1 .. $n).map({
        state $pie = 100.0;
        my $share = $pie * ($_ * 0.01);
        $pie -= $share;

        $_ => $share;
    })
    .max( *.value )
    .kv;

  say "Guest $topguest gets ",  $topshare, '% of the pie.';
}

# $perl6 test2_map.p6 5
#
# Guest 5 gets 4.5172512% of the pie.

»ö« Perl 6, Losing your Perl 5 Accent - Lance Wicks - LPW2019 🐪
sub MAIN(Int $n=100) {
  my ($topguest, $topshare) = (1 .. $n).map({
        state $pie = 100.0;
        my $share = $pie * ($_ * 0.01);
        $pie -= $share;

        $_ => $share;
    })
    .max( *.value )
    .kv;

  say "Guest $topguest gets ",  $topshare, '% of the pie.';
}

# $perl6 test2_map.p6 5
#
# Guest 5 gets 4.5172512% of the pie.

»ö« Perl 6, Losing your Perl 5 Accent - Lance Wicks - LPW2019 🐪
sub MAIN(Int $n=100) {
  my ($topguest, $topshare) = (1 .. $n).map({
        state $pie = 100.0;
        my $share = $pie * ($_ * 0.01);
        $pie -= $share;

        $_ => $share;
    })
    .max( *.value )
    .kv;

  say "Guest $topguest gets ",  $topshare, '% of the pie.';
}

# $perl6 test2_map.p6 5
#
# Guest 5 gets 4.5172512% of the pie.

Lets try CPAN

»ö« Perl 6, Losing your Perl 5 Accent - Lance Wicks - LPW2019 🐪
»ö« Perl 6, Losing your Perl 5 Accent - Lance Wicks - LPW2019 🐪
# Lingua::Postcodes

sub name {
    my $country_code = shift;
    if ( @_ == 0 ) {
        return unless exists $POSTCODES{$country_code};

        return $POSTCODES{$country_code}{'EN'};
    }
    else {
        my $language = shift;
        return unless exists $POSTCODES{$country_code}{$language};

        return $POSTCODES{$country_code}{$language};
    }
}
»ö« Perl 6, Losing your Perl 5 Accent - Lance Wicks - LPW2019 🐪
# Lingua::Postcodes (PERL 6)

multi sub name ($country_code) is export(:name) {
    return unless %POSTCODES{$country_code}:exists;

    return %POSTCODES{$country_code}{'EN'};
}

multi sub name ($country_code, $language) is export(:name) {
        return unless %POSTCODES{$country_code}{$language}:exists;

        return %POSTCODES{$country_code}{$language};
}
»ö« Perl 6, Losing your Perl 5 Accent - Lance Wicks - LPW2019 🐪
# Lingua::Postcodes (PERL 6)

multi sub name ($country_code) is export(:name) {
    return unless %POSTCODES{$country_code}:exists;

    return %POSTCODES{$country_code}{'EN'};
}

multi sub name ($country_code, $language) is export(:name) {
        return unless %POSTCODES{$country_code}{$language}:exists;

        return %POSTCODES{$country_code}{$language};
}
»ö« Perl 6, Losing your Perl 5 Accent - Lance Wicks - LPW2019 🐪
# Lingua::Postcodes (PERL 6)

multi sub name ($country_code) is export(:name) {
    return unless %POSTCODES{$country_code}:exists;

    return %POSTCODES{$country_code}{'EN'};
}

multi sub name ($country_code, $language) is export(:name) {
        return unless %POSTCODES{$country_code}{$language}:exists;

        return %POSTCODES{$country_code}{$language};
}
»ö« Perl 6, Losing your Perl 5 Accent - Lance Wicks - LPW2019 🐪
# Lingua::Postcodes (PERL 6)

multi sub name ($country_code) is export(:name) {
    return unless %POSTCODES{$country_code}:exists;

    return %POSTCODES{$country_code}{'EN'};
}

multi sub name ($country_code, $language) is export(:name) {
        return unless %POSTCODES{$country_code}{$language}:exists;

        return %POSTCODES{$country_code}{$language};
}

Lets try CPAN
#2

»ö« Perl 6, Losing your Perl 5 Accent - Lance Wicks - LPW2019 🐪
»ö« Perl 6, Losing your Perl 5 Accent - Lance Wicks - LPW2019 🐪
# Leftpad by Dave Golden

sub leftpad {
    no warnings 'uninitialized';
    return "" . $_[0] if $_[1] < 1;
    return sprintf( "%*s", $_[1], $_[0] ) unless defined $_[2] && length $_[2];
    return substr( $_[2], 0, 1 ) x ( $_[1] - length $_[0] ) . $_[0];
}
»ö« Perl 6, Losing your Perl 5 Accent - Lance Wicks - LPW2019 🐪
# Leftpad by Dave Golden in Perl 6

sub leftpad ($text, $pad?, $char?) is export {
    return "" ~ $text if $pad < 1;
    return sprintf( "%*s", $pad, $text.defined ?? $text.Str !! " " ) 
        unless $char.defined && $char.elems;
    
    return  $char.Str x ($pad - $text.elems ) ~ $text;
}
»ö« Perl 6, Losing your Perl 5 Accent - Lance Wicks - LPW2019 🐪
# Leftpad by Dave Golden in Perl 6

sub leftpad ($text, $pad?, $char?) is export {
    return "" ~ $text if $pad < 1;
    return sprintf( "%*s", $pad, $text.defined ?? $text.Str !! " " ) 
        unless $char.defined && $char.elems;
    
    return  $char.Str x ($pad - $text.elems ) ~ $text;
}
»ö« Perl 6, Losing your Perl 5 Accent - Lance Wicks - LPW2019 🐪
# Leftpad by Dave Golden in Perl 6

sub leftpad ($text, $pad?, $char?) is export {
    return "" ~ $text if $pad < 1;
    return sprintf( "%*s", $pad, $text.defined ?? $text.Str !! " " ) 
        unless $char.defined && $char.elems;
    
    return  $char.Str x ($pad - $text.elems ) ~ $text;
}
»ö« Perl 6, Losing your Perl 5 Accent - Lance Wicks - LPW2019 🐪
# Leftpad by Dave Golden in Perl 6

sub leftpad ($text, $pad?, $char?) is export {
    return "" ~ $text if $pad < 1;
    return sprintf( "%*s", $pad, $text.defined ?? $text.Str !! " " ) 
        unless $char.defined && $char.elems;
    
    return  $char.Str x ($pad - $text.elems ) ~ $text;
}

Lets get concurrent

»ö« Perl 6, Losing your Perl 5 Accent - Lance Wicks - LPW2019 🐪
»ö« Perl 6, Losing your Perl 5 Accent - Lance Wicks - LPW2019 🐪
# Based on https://www.perl.com/article/fork-yeah-/

for (1..5) {
  my $pid = fork;
  die "failed to fork: $!" unless defined $pid;
  next if $pid;

  sleep 5 - int(rand($_));
  print "$_\n";
  exit;
}
my $kid;
do {
  $kid = waitpid -1, 0;
} while ($kid > 0);


# 3
# 4
# 2
# 1
# 5
»ö« Perl 6, Losing your Perl 5 Accent - Lance Wicks - LPW2019 🐪
await do for 1..5 -> $i {
    start {
       sleep (1..$i).pick;
       say $i;
    }
}


# 1
# 3
# 4
# 2
# 5
»ö« Perl 6, Losing your Perl 5 Accent - Lance Wicks - LPW2019 🐪
await do for 1..5 -> $i {
    start {
       sleep (1..$i).pick;
       say $i;
    }
}


# 1
# 3
# 4
# 2
# 5
»ö« Perl 6, Losing your Perl 5 Accent - Lance Wicks - LPW2019 🐪
await do for 1..5 -> $i {
    start {
       sleep (1..$i).pick;
       say $i;
    }
}


# 1
# 3
# 4
# 2
# 5
»ö« Perl 6, Losing your Perl 5 Accent - Lance Wicks - LPW2019 🐪
await do for 1..5 -> $i {
    start {
       sleep (1..$i).pick;
       say $i;
    }
}


# 1
# 3
# 4
# 2
# 5

I speak Perl 6
with a Perl 5 Accent

»ö« Perl 6, Losing your Perl 5 Accent - Lance Wicks - LPW2019 🐪

But I am slowly losing the accent

»ö« Perl 6, Losing your Perl 5 Accent - Lance Wicks - LPW2019 🐪

Perl6 ≠ Perl5

 Māori ≠ Māori 

»ö« Perl 6, Losing your Perl 5 Accent - Lance Wicks - LPW2019 🐪

RAKU ≠ Perl5

 Māori ≠ Māori 

»ö« Perl 6, Losing your Perl 5 Accent - Lance Wicks - LPW2019 🐪

And that is ok

»ö« Perl 6, Losing your Perl 5 Accent - Lance Wicks - LPW2019 🐪

as they are in one "Whanau"
(Family)

»ö« Perl 6, Losing your Perl 5 Accent - Lance Wicks - LPW2019 🐪

being
multi-lingual is good

»ö« Perl 6, Losing your Perl 5 Accent - Lance Wicks - LPW2019 🐪

being
​multi-lingual is easy

»ö« Perl 6, Losing your Perl 5 Accent - Lance Wicks - LPW2019 🐪

And you can learn the perl6 Accent

»ö« Perl 6, Losing your Perl 5 Accent - Lance Wicks - LPW2019 🐪

And you can learn the raku Accent

»ö« Perl 6, Losing your Perl 5 Accent - Lance Wicks - LPW2019 🐪

Thank you

»ö« Perl 6, Losing your Perl 5 Accent - Lance Wicks - LPW2019 🐪

Bonus
Slides

»ö« Perl 6, Losing your Perl 5 Accent - Lance Wicks - LPW2019 🐪

FLoating Point Math

»ö« Perl 6, Losing your Perl 5 Accent - Lance Wicks - LPW2019 🐪

say 0.1 + 0.2 - 0.3

»ö« Perl 6, Losing your Perl 5 Accent - Lance Wicks - LPW2019 🐪
say print (0.1 + 0.2 - 0.3);


5.55111512312578e-17
say  (0.1 + 0.2 - 0.3);

0

Magical consistency

»ö« Perl 6, Losing your Perl 5 Accent - Lance Wicks - LPW2019 🐪
say Date.today;
say Date.today.later(month => 1);
say Date.today.later(:month);

# 2019-10-16
# 2019-11-16
# 2019-11-16

Thank you

»ö« Perl 6, Losing your Perl 5 Accent - Lance Wicks - LPW2019 🐪

LPW2019

By Lance Wicks

LPW2019

Perl 6, losing your Perl 5 accent. The joke I make regularly is "I speak Perl 6, just with a heavy Perl 5 accent". This session is all about losing that accent and writing more idiomatic Perl 6. Perl 6, will allow you to write code that is very much like Perl 5. This is is awesome, but means you can miss some of the great parts of Perl 6. In this talk we will take some working Perl 6 code written in a Perl 5 style and change it to be more Perl 6 like. Audience participation may be required. ;-)

  • 1,876