Skip to content

Instantly share code, notes, and snippets.

@sergot
Last active December 16, 2015 20:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sergot/5496535 to your computer and use it in GitHub Desktop.
Save sergot/5496535 to your computer and use it in GitHub Desktop.
My solutions. masak/workshop
use v6;
say "Just another Perl hacker";
use v6;
# Program 1
print (.split('')[2] or '') for lines();
# Program 2
my $s; $s += $_ for lines(); say $s;
# Program 3
say $_~"\n" for lines();
# Program 4
my $n; say "{++$n}.$_" for lines();
# Program 5
for lines() { last if m:i/^end$/; next if m:i/^start$/; .say; }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment