Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^2: Generating a range of Unicode characters

by davido (Cardinal)
on Nov 16, 2017 at 06:21 UTC ( [id://1203556]=note: print w/replies, xml ) Need Help??


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

Replies are listed 'Best First'.
Is skipping map() and chr() possible?
by mldvx4 (Friar) 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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1203556]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (3)
As of 2024-03-29 02:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found