Skip to content

Instantly share code, notes, and snippets.

@JJ JJ/sections.p6
Created Dec 2, 2017

What would you like to do?
Finds the "good" in a series of sections
use Text::Markdown;
sub MAIN( Str $letter-to-santa = 'letters/' ) {
my $letter =$letter-to-santa.IO.slurp());
my $flip = False;
my @paragraphs = $letter.items.grep( { $flip = ($^þ ~~ Text::Markdown::Heading and $^þ.level == 2)?? !$flip !! $flip } );
say so any {$^þ.Str ~~ /good/ } );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.