Skip to content

Instantly share code, notes, and snippets.

@JJ
Created December 2, 2017 08:43
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 JJ/56533f9cb659b45012f15bbf18286ebc to your computer and use it in GitHub Desktop.
Save JJ/56533f9cb659b45012f15bbf18286ebc to your computer and use it in GitHub Desktop.
Split by `and`
use JSON::Tiny;
sub MAIN( Str $letter-to-santa = 'letters/dear-santa.txt' ) {
say to-json $letter-to-santa.IO.slurp().split(/\s* «and» \s*/);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment