½ÃÀÛÆäÀÌÁö·Î Áñ°Üã±âÃß°¡
·Î±×ÀÎ
ȸ¿ø°¡ÀÔ l Ã⼮üũ l ¸¶ÀÌÆäÀÌÁö l CGIMALL
ÀÚ·á½Ç »çÀÌÆ®µî·Ï ·©Å·100 ÇÁ·Î±×·¥¸®ºä °ü¸®ÀÚÃßõÀÚ·á Ãʺ¸°¡À̵å
Ä¿¹Â´ÏƼ
Àüü ÆîÃ帱â
Äü¸Þ´º¸µÅ© jquery , CSS , PHP , Javascript , ¹«·áÆùÆ® , ASP
»ó¼¼°Ë»ö
Ȩ > Ä¿¹Â´ÏƼ > °ñµåÆÁ »ó¼¼º¸±â
Ä¿¹Â´ÏƼ ±¸Àα¸Á÷
»çÀÌÆ®µî·Ï
Ŭ¶ó¿ìµåű×
javascript
PHP
ASP
CSS
mysql
html
jquery
������
image
mobile
API
slide
°Ô½ÃÆÇ
ÇöÀçÁ¢¼ÓÀÚ ¸í »õ·Î°íħ
°Ô½ÃÆÇŸÀÌƲ °ñµåÆÁ / »ó¼¼º¸±â
Æ®À§ÅÍ·Î º¸³»±â
Ãßõ¼ö 312 | Á¶È¸¼ö 3,862 | µî·ÏÀÏ 2001-03-18 17:30:45

´Ð³×ÀÓ

HappyCGI

Á¦¸ñ

ÅؽºÆ®ÆÄÀÏ »èÁ¦ÆÁ
³»¿ë
ÆÞ ¸¶´Ï¾Æ (http://perlmania.or.kr/) ¹ßÃé±ÛÀÔ´Ï´Ù.
ÆÄÀÏÇÑÁÙ¾¿ Àо ÇØ´çÇÏ´Â ¹®ÀÚ¿­ÀÌ ¿ÔÀ»¶§
»èÁ¦½ÃÅ°´Â °£´ÜÇÑ ·ÎÁ÷ÀÔ´Ï´Ù.
ÀϹÝÀûÀ¸·Î ÅؽºÆ® °Ô½ÃÆÇÀ̳ª ÅؽºÆ® ¹æ¸í·Ï¿¡¼­ ¸¹ÀÌ
¾²ÀÌ´Â ¹æ¹ýÀÌÁÒ. ^^

¿ø¹®½ÃÀÛ (±èÇö½Â´Ô±Û)
###################################################
ÆÄÀÏ¿¡¼­ ÇÊ¿äÇÑ ºÎºÐ¸¸ ó¸®ÇÏ´Â °É ¸î¹ø Çغôµ¥¿ä
ÀÌ·¸°Ô Çϸé Á» ³´½À´Ï´Ù.

######### ¹æ¹ý1 "¹Ùº¸"¶ó´Â ¹®ÀÚ¿­ÀÌ µé¾îÀÖ´Â ¶óÀÎÀ» »èÁ¦½Ã

open(INFILE,"<data.txt");
open(OUTFILE,">temp.txt"); #ÀÓ½ÃÆÄÀÏ
while(<FILE>){ # ÇÑÁÙ¾¿ Àо ó¸®ÇÏ´Ï±î ¸Þ¸ð¸® º°·Î ¾È¾¸
print OUTFILE $_ if(! ($_=~/¹Ùº¸/) ); #ÇØ´çµÇ´Â ³»¿ëÀÇ ¶óÀÎÀº Ãâ·Â¾ÊÀ½
}
close(OUTFILE);
close(INFILE);
unlink("data.txt");
rename("temp.txt","data.txt"); # »õ·Î »ý¼ºÇÑ ÆÄÀÏ·Î ´ëü

######### ¹æ¹ý2 À妽ºÆÄÀÏ°ú µ¥ÀÌÅÍÆÄÀÏ·Î ³ª´©±â(Á» °í³­µµ)

&adddat("³ª¹ÙºÎ´Ù."); #<-- 9¹ÙÀÌƮũ±âÀÔ´Ï´Ù.
&adddat("´Ï´Â¾Æ´Ï°¡?"); #<-- 11¹ÙÀÌÆ®ÀÔ´Ï´Ù.
&adddat("12345"); #<-- 5¹ÙÀÌÆ®ÀÔ´Ï´Ù.

[test.idxÀÇ ³»¿ë(½ÃÀÛ¹ÙÀÌÆ®:µ¥ÀÌÅÍÀÇ ±æÀÌ)]
0:9 <--°¢ µ¥ÀÌÅ͸¶´Ù ±â·Ï
9:11
20:5

[test.datÀÇ ³»¿ë]
³ª¹ÙºÎ´Ù.´Ï´Â¾Æ´Ï°¡?12345

print &getdat(1);
[°á°ú]
´Ï´Â¾Æ´Ï°¡?

### ±ÛÀÇ Ãß°¡
sub adddat($){ #ÀúÀåÇÏ·Á´Â ½ºÄ®¶ó¸¦ Àμö·Î ÁØ´Ù.
open(IDX,">>test.idx");
local($start)= -s"test.dat";
local($len)=length($_[0]);
print IDX "$start:$len
";
close(IDX);
open(DAT,">>test.dat");
print DAT "$_[0]";
close(DAT);
}
### ±ÛÀÇ ¿­¶÷
sub getdat($){ #°¡Á®¿À·Á´Â ¶óÀιøÈ£¸¦ Àμö·Î ÁØ´Ù.
local($ret,$i,$each);
open(IDX,"<test.idx");
while($each=<IDX>){
if($i==$_[0]){
chomp($each);
local($start,$len)=split(:,$each);
open(DAT,"<test.dat");
seek(DAT,$start,0); #óÀ½ºÎÅÍ $start¸¸Å­ °Ç³Ê¶Ü
read(DAT,$ret,$len);
#ÀÌ°Ô ¸Â³ª ¸ô°Ú³×¿ä DAT¿¡¼­ $len¸¸Å­ Àо $ret¿¡ ÀúÀå.
#Ȥ½Ã ¾Æ´Ï¸é ¸Â°Ô °íÃÄÁÖ¼¼¿ä
close(DAT);
last;
}
$i++; #ÇöÀç ¶óÀιøÈ£ Ä«¿îÅÍ
}
return($ret); #Àоî¿Â °ªÀ» ¹Ýȯ
}
### ÇØ´ç ¶óÀÎÀÇ »èÁ¦ - ¿­¶÷¸¸ ¾ÈµÇ¸é µÇ¹Ç·Î À妽º Á¤º¸¸¸ »èÁ¦
sub deldat($){
local($ret,$i,$each);
open(IDX,"<test.idx");
open(TEMP,">temp.idx");
while($each=<IDX>){
print TEMP "$each" if ( $i != $_[0] ); #ÇØ´ç ¶óÀθ¸ »©°í »õ·Î »ý¼º
$i++;
}
close(TEMP);
close(IDX);
unlink("test.idx");
rename("temp.idx","test.idx"); # ±âÁ¸ À妽º ´ëü
}

ÀÌ·¸°Ô ÇÏ¸é µ¥ÀÌÅÍ ÆÄÀÏ¿¡´Â ½ÇÁúÀûÀ¸·Î »èÁ¦°¡ ¾ÈµÇ°í
¿­¶÷¸¸ ¸øÇÏ°Ô µÇÁÒ. µ¥ÀÌÅÍ ÆÄÀÏÀÇ ³»¿ëÀ» º¯°æµÈ À妽º¿¡ ¸ÂÃç
Á¤¸®ÇÏ·Á¸é °¢µ¥ÀÌÅ͸¦ Àоî¿Í »õ·ÎÀÌ À妽º¿Í µ¥ÀÌÅÍÆÄÀÏÀ» »ý¼ºÇÏ¸é µË´Ï´Ù.

°Ë»ö±â´É°ú ¼öÁ¤,»ðÀÔ °°Àº ±â´Éµµ ÀÌ·± ¹æ¹ýÀ¸·Î ¸¸µé¼ö ÀÖ½À´Ï´Ù.

µµ¿òÀÌ µÇ¼Ì±æ
Ãßõ½ºÅ©·¦¼Ò½ºº¸±â ¸ñ·Ï
ÀÌÀü°Ô½Ã±Û À©µµ¿ì 2000¼­¹ö¿¡¼­ smtp¸¦ ÀÌ¿ëÇÑ ¸ÞÀÏ ³¯¸®±â (¼¼ÆȺ¸µå¿¹Á¦) 2001-01-14 07:49:34
´ÙÀ½°Ô½Ã±Û ¹é±×¶ó¿îµå·ÎÀÇ ½ÇÇà 2001-03-25 14:57:47