in reply to Re: generating a character sequence
in thread generating a character sequence
Let me add a short explanation to that. This is a precedence problem, your statement is read as (I only show the map part here): map { ord('a'+$_%26) } 0..$n-1;Both things are added first and then passed to ord - btw, with use warnings you get a warning about 'a' not being numeric in addition ... this should have been sufficient as an explanation ;-)
So I0's solution works nicely or you can also write map { ord('a')+$_%26 } 0..$n-1; according to the rule: 'What looks like a function, is a function!'
-- Hofmator
|
|---|