Acme-Glue

 view release on metacpan or  search on metacpan

README.md  view on Meta::CPAN

Here are the snippets that may accompany the photo project

## LEEJO (transform.pl)

    #!/usr/bin/env perl
    #
    # transform an array of hashes into an array of arrays where each array
    # contains the values from the hash sorted by the original hash keys or
    # the passed order of columns (hash slicing)
    my @ordered = $column_order
        ? map { [ @$_{ @{ $column_order } } ] } @{ $chaos }
        : map { [ @$_{sort keys %$_} ] } @{ $chaos };

## LEEJO (hopscotch.p6)

    #!/usr/bin/env perl6

    my @court = (
        [ 'FIN' ],
        [ 9 ,10 ],
        [   8   ],
        [ 6 , 7 ],
        [   5   ],
        [   4   ],
        [ 2 , 3 ],
        [   1   ],
    );

    my $skip = @court.[1..*].pick.pick;
    my @play;

    for @court.reverse -> $hop {
        @play.push( $hop.map( *.subst( /^$skip$/,'🚫' ).list ) );
    }

    say @play.reverse.join( "\n" );

## LEEJO (vec and pack examples from perldoc vec)

    #!/usr/bin/env perl -wl

    print <<'EOT';
                                      0         1         2         3

README.md  view on Meta::CPAN


    10 PRINT CHR$(205.5+RND(1));:GOTO 10

## SLU (schwartzian\_transform.pl)

    #!/usr/bin/env perl
    # https://en.wikipedia.org/wiki/Schwartzian_transform
    # Sort list of words according to word length

    print "$_\n" foreach
      map  { $_->[0] }
      sort { $a->[1] <=> $b->[1] or $a->[0] cmp $b->[0] }
      map  { [$_, length($_)] }
      qw(demo of schwartzian transform);

## LIST OF WORKSHOPS / CONFERENCES

A full list of the workshops and conferences this project was shot at

- Alpine Perl Workshop (2016)
- FOSDEM (2024)
- German Perl Workshop (2019)
- German Perl and Raku Workshop (2022, 2023, 2024)

lib/Acme/Glue.pm  view on Meta::CPAN

Here are the snippets that may accompany the photo project

=head2 LEEJO (transform.pl)

    #!/usr/bin/env perl
    #
    # transform an array of hashes into an array of arrays where each array
    # contains the values from the hash sorted by the original hash keys or
    # the passed order of columns (hash slicing)
    my @ordered = $column_order
        ? map { [ @$_{ @{ $column_order } } ] } @{ $chaos }
        : map { [ @$_{sort keys %$_} ] } @{ $chaos };

=head2 LEEJO (hopscotch.p6)

    #!/usr/bin/env perl6

    my @court = (
        [ 'FIN' ],
        [ 9 ,10 ],
        [   8   ],
        [ 6 , 7 ],
        [   5   ],
        [   4   ],
        [ 2 , 3 ],
        [   1   ],
    );

    my $skip = @court.[1..*].pick.pick;
    my @play;

    for @court.reverse -> $hop {
        @play.push( $hop.map( *.subst( /^$skip$/,'🚫' ).list ) );
    }

    say @play.reverse.join( "\n" );

=head2 LEEJO (vec and pack examples from perldoc vec)

    #!/usr/bin/env perl -wl

    print <<'EOT';
                                      0         1         2         3

lib/Acme/Glue.pm  view on Meta::CPAN

    10 PRINT CHR$(205.5+RND(1));:GOTO 10

=head2 SLU (schwartzian_transform.pl)


    #!/usr/bin/env perl
    # https://en.wikipedia.org/wiki/Schwartzian_transform
    # Sort list of words according to word length

    print "$_\n" foreach
      map  { $_->[0] }
      sort { $a->[1] <=> $b->[1] or $a->[0] cmp $b->[0] }
      map  { [$_, length($_)] }
      qw(demo of schwartzian transform);

=head2 LIST OF WORKSHOPS / CONFERENCES

A full list of the workshops and conferences this project was shot at

=over

=item Alpine Perl Workshop (2016)

snippets/LEEJO/hopscotch.p6  view on Meta::CPAN

	[   5   ],
	[   4   ],
	[ 2 , 3 ],
	[   1   ],
);

my $skip = @court.[1..*].pick.pick;
my @play;

for @court.reverse -> $hop {
	@play.push( $hop.map( *.subst( /^$skip$/,'🚫' ).list ) );
}

say @play.reverse.join( "\n" );

snippets/LEEJO/transform.pl  view on Meta::CPAN

		1 => 'Liz',
		2 => 'Nat',
		3 => 'Lee',
	},
];

# transform an array of hashes into an array of arrays where each array
# contains the values from the hash sorted by the original hash keys or
# the passed order of columns (hash slicing)
my @ordered = @{ $required_order // [] }
    ? map { [ @$_{ @{ $required_order } } ] } @{ $chaos }
    : map { [ @$_{sort keys %$_} ] } @{ $chaos };

say join( ",",map { @{ $_ } } @ordered );

snippets/SLU/schwartzian_transform.pl  view on Meta::CPAN

#!/usr/bin/env perl
# https://en.wikipedia.org/wiki/Schwartzian_transform
# Sort list of words according to word length

print "$_\n" foreach
  map  { $_->[0] }
  sort { $a->[1] <=> $b->[1] or $a->[0] cmp $b->[0] }
  map  { [$_, length($_)] }
  qw(demo of schwartzian transform);



( run in 0.799 second using v1.01-cache-2.11-cpan-49f99fa48dc )