Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

Re: Ascii Chart

by belg4mit (Prior)
on Feb 25, 2003 at 17:35 UTC ( #238495=note: print w/replies, xml ) Need Help??

in reply to Ascii Chart

At the author's behest, a somehwat exhaustive list of nits.
  • The need is not apparent
  • Storing the ord, instead of using $./the index
  • Storing the ord in so many formats when perl provides conversion functions
  • Maybe use format and write?
  • UPDATE: Since it's a line per entry anyways, the ability to customize the output is overkill
  • Extensibility? ie; support for EBDIC, locale specific code pages, or unicode?
  • "n Digit" would look better and be more consistent as as "Digit n"
  • Lower-case vs. Capital

I'm not belgian but I play one on TV.

Replies are listed 'Best First'.
Re: Re: Ascii Chart
by runrig (Abbot) on Feb 25, 2003 at 18:49 UTC
    The data already existed, so when I wrote the program I tried to do as little work as possible to format it. I disagree with the 'apparent need', though, since if there was no need there wouldn't be an ascii man page on the systems that have one (of course, on those systems with an ascii man page, I agree that there is no apparent need for this script).

    I thought about using printf to format the numbers rather than leaving them hard coded, but at the time I liked the idea of leaving it hard-coded for easy viewing and re-usability of the data (and it required less work on my part). And using $. is a good idea, but likewise I'd rather be able to look at the data and see which line is which.

    If I were to use formats, format and write would probably have to be formline and $^A since the format is dynamic, but that and EBCDIC and locale specific code pages and unicode are left as projects for those with more time than I have :-)

    Taking out the hard coding of the hex and binary numbers wasn't too hard though, so here's my first pass at that (I may add octal later)(Update: Added octal - didn't want to do it until I tested it, and zentara is right, it was easy enough):

Log In?

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2023-12-05 02:23 GMT
Find Nodes?
    Voting Booth?
    What's your preferred 'use VERSION' for new CPAN modules in 2023?

    Results (25 votes). Check out past polls.