´äº¯°¨»çÇÕ´Ï´Ù. ´äº¯ÇØÁֽŠ³»¿ëÀ» ¾Æ·¡ ó·³ »ðÀÔÀ» Çߴµ¥¿ä
¹» Àß ¸øÇÑ°ÇÁö ¾Æ·¡ÀÇ $cut_length°ªÀ» Ȧ¼ö·Î ÇßÀ»¶§
Ãâ·Â±ÛÀÚÀÇ ³¡ÀÌ Á¤»óÀûÀ¸·Î ³ª¿ÀÁö ¾Ê½À´Ï´Ù.
Á˼ÛÇÕ´Ï´Ù. Á¶¾ðÀ» ºÎŹµå¸³´Ï´Ù. °¨»çÇÕ´Ï´Ù.
#!/usr/bin/perl
$org = "¿ì¸®³ª¶ó¸¸¼¼";
$cut_length = 9;
($out,$result) = hangul_cut($org,$cut_length);
print "($out)
";
#------------------------------------------------------------------------
sub hangul_cut {
local ($data, $len) = @_;
local $check;
if (length $data > $len) {
$data = substr $data, 0, $len;
chop $data if ($data =~ y/[xA1-xFE]//) %2 != 0;
$check = 1;
}
return $data, $check;
}
#------------------------------------------------------------------------
|