Skip to content

Instantly share code, notes, and snippets.

@Ovid
Last active August 29, 2015 14:13
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 Ovid/fc552949223750349a8b to your computer and use it in GitHub Desktop.
Save Ovid/fc552949223750349a8b to your computer and use it in GitHub Desktop.
Why does this show empty strings?
# Given:
# $ cat plans.csv
# this,that
# one,two
# same,same
my $fh = open('plans.csv');
for $fh.lines.grep({ / $<key>=\w+ ',' $<value>=\w+ / }) {
say ~$<key> => ~$<value>;
}
# Output:
# "" => ""
# "" => ""
# "" => ""
# This is perl6 version 2014.12 built on MoarVM version 2014.12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment