Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

-p causes change in $0 in {} in "" in right-hand side of assignment to special s[] form in Rakudo #3772

Closed
p6rt opened this issue Apr 6, 2015 · 4 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Apr 6, 2015

Migrated from rt.perl.org#124247 (status was 'resolved')

Searchable as RT124247$

@p6rt
Copy link
Author

p6rt commented Apr 6, 2015

From @masak

$ 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

@p6rt
Copy link
Author

p6rt commented Sep 3, 2017

From @skids

On Mon, 06 Apr 2015 07​:22​:19 -0700, masak wrote​:

$ 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

$ echo 5 breads and 2 fish | perl6 -pe 's[(\d)] = "{$0 * 10}"'
50 breads and 2 fish

Seems to have been resolved at some point.
Tests added to S19-command-line-options/03-dash-p.t

Marking ticket resolved.

@p6rt
Copy link
Author

p6rt commented Sep 3, 2017

The RT System itself - Status changed from 'new' to 'open'

@p6rt p6rt closed this as completed Sep 3, 2017
@p6rt
Copy link
Author

p6rt commented Sep 3, 2017

@skids - Status changed from 'open' to 'resolved'

@p6rt p6rt added the Bug label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant