Skip to content

Instantly share code, notes, and snippets.

@masak

masak/bug.txt Secret

Created April 6, 2015 14:18
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 masak/3a8ab0dc74d6c6c25287 to your computer and use it in GitHub Desktop.
Save masak/3a8ab0dc74d6c6c25287 to your computer and use it in GitHub Desktop.
Found a -p bug in Rakudo
$ perl6 -v
This is perl6 version 2015.03-170-g143f621 built on MoarVM version 2015.03-49-gce786a1
$ perl6 -e '$_ = "5 breads and 2 fish"; s[(\d)] = "{$0 * 10}"; .say'
50 breads and 2 fish
$ cat input
5 breads and 2 fish
$ perl6 -pe 's[(\d)] = "{$0 * 10}"' < input
use of uninitialized value of type Nil in numeric context in block <unit> at -e:1
0 breads and 2 fish
Expectation: that `s[(\d)] = "{$0 * 10}"` statement shouldn't give a warning about $0 being Nil, just because I'm in -p
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment