PERL:



PERL: - . 45


rd ­ ch r :

$num = ord($char), $char = chr($num),


1.4. ASCII-蠠 35

% printf spnntf -

$char = sprintf( %c , $num), # 堠 chr($num)

printf( Number %d is character %c\n , $num, $num) Number 101 is character e

*, pack unpack, ­ :

@ASCII = unpack( * $stnng) STRING = pack( C* $ascn),

, , Perl ; . , , . ­ Perl chr ord, Pascal:

$ascu_value = ord( e ) ft 101 Icharacter = ch(101), ft

, ­ print %s ­ printf spnntf % printf spnntf , , ( ).

printf( Number %d is character %c\n 101 101),

pack, unpack, chr ord , spnntf. ­ pack unpack.

@ascn_character_numbers = unpack( * , sample ), print (eiascii_character_numbers\n , 115 97 109 112 108 101

$word = pack( C ascn_character_nurabers),

Sword = pack( C* 115, 97, 109, 112, 108 101), # To

print $word\n

sample

HAL IBM:

$hal = HAL ,

@ascn = unpack( C* , $hal),