March 08, 2017

The method of converting ASCII to number with perl


□ ASCII → Number : perl -e 'print ord("[ASCII code]")'

□ Number → ASCII : perl -e 'print chr([Number])'

※ If you think the ord as the abbreviation of ordinal, it is easy to memorize when you think of the function as giving character order number of ASCII code. And iIf you think the chr as the abbreviation of charater, it is easy to memorize when you think of the function as giving character of ASCII codes.
※ ord는 ordinal(서수)의 줄임 말로, ASCII 코드의 문자 순서 번호를 알려주는 함수라고 생각하면 외우기 쉽다. chr는 character(문자)의 줄임 말로, ASCII 코드의 어떤 문자인지 알려주는 함수라고 외우면 쉽다.