|
use strict;
my $input = "AaBb";
my @String = split '',$input;
my @binary = unpack "B8"x4,$input;
my @decimal = unpack "C*",$input;
printf "%5s | %-8s | %-8s \n","¹®ÀÚ","10Áø¼ö","2Áø¼ö";
foreach(0..$#String){
print "="x 30 . "\n" if($_%2-1);
printf "%5s | %-8s | %-8s \n",$String[$_],$decimal[$_],$binary[$_];
}
#==================================================================#
#!/usr/bin/perl
$str=":5";
my @s=$str=~/(.*):(.*)/;
print join("_",@s)."\n";
$b=0x12345678;
$b="12345678";
printf("%x %d\n",$b,$b);
@s=reverse split /(..)/,$b;
print @s."\n";
print join("_",@s)."\n";
print unpack "H8", reverse split /(..)/,$b;
print "\n";
$b="abcdef";
print "KK15:$b:";
print join ",",@s .":";
print join ",",unpack "C6", reverse split /(..)/, $b;
print "\n\tunpack0a:".unpack "C6", $b;
print "\n\tunpack0b:".unpack "C6", split(/(..)/,$b);
print "\n\tunpack0:".unpack "C6", reverse split /(..)/, $b;
print "\n\tunpack1:".unpack "a*", reverse split /(..)/, $b;
@s=reverse split /(..)/,$b;
print "\n\tunpack2:".unpack "a*", @s; |
|