Re: How to do a substring replacement in Perl 6
Hi all! From http://perldoc.perl.org/functions/substr.html: substr has a 4th argument (or you can use substr as an lvalue) for replacement. substr EXPR,OFFSET,LENGTH,REPLACEMENT From http://doc.perl6.org/routine/substr I don't see any way to do a replacement. What is the idiomatic way of doing a positional string replacement in Perl 6? Thanks! Method form: $ perl6 -e 'my $s = abc; $s.substr-rw(1,1) = z; say $s;' azc Function form: $ perl6 -e 'my $s = abc; substr-rw($s, 1,1) = z; say $s;' azc I also do not see substr-rw in doc.perl6.org. It needs to be added. In the meantime, you can find it here: http://design.perl6.org/S32/Str.html thanks, Bruce, for the examples! I've added these to the doc.perl6.org documentation. The entry for substr-rw should appear in roughly half an hour. Cheers, Paul
panda seeing duplicate symbol definitions
l.s. Installing the BSON module gives the following fault when it runs the tests. It fails in t/700-encodable.t as shown below $ panda install BSON ... t/100-double.t . ok t/101-binary.t . ok t/102-int.t ok t/500-native.t . ok t/600-extended.t ... ok ===SORRY!=== Merging GLOBAL symbols failed: duplicate definition of symbol Encodable t/700-encodable.t .. No subtests run t/701-decoder.t ok t/703-encodable.t .. ok ... Locally testing with prove does not reveil such a problem. In the test file there is made use of to modules BSON::Encodable and BSON::Double. The problem for panda is presumably that BSON::Double also uses BSON::Encodable. For the moment I've shortened the test and inserted a comment '#' before the use of that module. Greets, Marcel Timmerman