Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re^2: [Perl6] Seq iterator already consumedby Athanasius (Archbishop) |
on Jun 17, 2019 at 12:24 UTC ( [id://11101460]=note: print w/replies, xml ) | Need Help?? |
Thanks, choroba. I didn’t know about .^name — that’s useful. I found this explanation under https://docs.perl6.org/language/classtut#Introspection: The syntax of calling a method with .^ instead of a single dot means that it is actually a method call on its meta class, ... I’ll have to look into that.
Actually, at this point @dirs contains two Seq objects. I think the subsequent call to split iterates each Seq (which is ok, since a Seq is a one-shot iterable); the later call to map attempts to iterate them again, causing the error. This explanation would be fine if it weren’t for line C. Since join iterates over the Seq, it should be line C that produces the error. But it isn’t — and, as I stated in the OP, removing line C removes the error at line D too. So, still confused. :-( But I did find another fix: change line A to this:
At least this looks less like a kludge than line B. Cheers,
In Section
Seekers of Perl Wisdom
|
|