in reply to Re: Generating a range of Unicode characters
in thread Generating a range of Unicode characters

You have been upvoted: I took way too long to get to the point. ;)


Dave

  • Comment on Re^2: Generating a range of Unicode characters

Replies are listed 'Best First'.
Is skipping map() and chr() possible?
by mldvx4 (Hermit) on Nov 16, 2017 at 06:38 UTC

    Thanks, both of you. The following produces the output I am expecting.

    perl -e '$a=join("",map ({chr} 0xdf .. 0x0101)); print "$a\n";'

    I guess there is no way to do the Unicode equivalent of 'A' .. 'Z' instead.

    Is there some way to skip the map() or chr() functions?

      Is there some way to skip the map() or chr() functions?

      Why would you want to skip them? Any why them but not join? Seems rather arbitrary.

      You'll need chr however you go about this and it is not a difficult fuction to understand. map can be avoided but you'll still need some sort of iterative/looping structure. eg:

      perl -e 'print chr for 0xdf .. 0x0101, 0xa';

      That's with *nix EOL.

      Is there some way to skip the map() or chr() functions?
      Probably not. The 0xdf .. 0x0101 construct is just a range of numbers, you need, one way or another, to convert these numbers into characters.
Re^3: Generating a range of Unicode characters
by Your Mother (Archbishop) on Nov 16, 2017 at 06:42 UTC

    :P My short attention span cannot excuse me. You covered all the bases quite nicely, as usual. I was reading on my phone though, if that is a mitigating factor.