>»çÀ̹ö °ÀÇ·Î ÀÎÅÍ³Ý °ú¸ñÀ» µè°íÀִµ¥ ½ÃÇè¹®Á¦°¡ perl °ü·ÃÇؼ ³ª¿Í¼ Á» °ï¶õÇϱº¿ä. >c´Â ¾îÂî Çغ¸°Ú´Âµ¥ perl ÂÊÀº µµÅë °¨À» ¸øÀâ°Ú´õ¶ó±¸¿ä. >¾Æ½Ã´Â ºÐÀÇ µµ¿òÀ» ¿äûÇÕ´Ï´Ù. > >¾Æ·¡´Â ¹®Á¦ÀÔ´Ï´Ù. ´äÀ» ¾Æ½Ã´Â ºÐÀº Á» ¾Ë·ÁÁÖ¼¼¿ä. >Á¦ÃâÀÌ ¿À´Ã Àú³á±îÁö¶ó¼ Á» ½Ã°£ÀÌ ¾ø³×¿ä. >±ÍÂú°Ô Çصå·Á¼ Á˼ÛÇϱ¸¿ä ±×·³.... > >===================================================== > >7. º¯¼ö vari¿¡ ´ÙÀ½°ú °°ÀÌ °ªÀ» ÀúÀåÇÏ¿´´Ù. >%vari=("Sun","Mon",Tue","Wed","Thu","Fri"); >ȸ鿡 4¹ø°¿¡ Ç¥½ÃµÈ Wed¸¦ ȸ鿡 Ãâ·ÂÇÏ·Á°í ÇÑ´Ù. print¸¦ ÀÌ¿ëÇؼ Ãâ·ÂÇÏ¿© º¸¾Æ¶ó. > >8. ´ÙÀ½Àº ¹è¿ÀÇ ¿ø¼Ò Áß ÃÖ´ë °ªÀ» ±¸ÇÏ´Â ÇÁ·Î±×·¥À» perl·Î ÀÛ¼ºÇÑ °ÍÀÌ´Ù. °á°ú °ªÀÎ 87À» Ãâ·ÂÇϱâ À§ÇØ ¨çÀ» ä¿ö¶ó > >#!/usr/bin/perl > >@tt = ( 10, 40, 33, 51, 87, 9, 15, 22, 25 ); >$t = &max( @tt ); >print $t; > >sub max { > > > ¨ç > >}
¾È³çÇϼ¼¿ä. ÇØÇÇCGI À¥¸¶½ºÅÍ À±¿µ¿õÀÔ´Ï´Ù. ¼÷Á¦±º¿ä. -_-;;; ±×·¡¼ õõÈ÷ ´äº¯ µå¸°°Ç ¾Æ´Õ´Ï´Ù. ^^
7¹ø ´ä
#!/usr/bin/perl print "content-type:text/html\n\n"; %vari=("Sun","Mon","Tue","Wed","Thu","Fri"); print "$vari{Tue}";
8¹ø ´ä #!/usr/bin/perl print "content-type:text/html\n\n"; @tt = ( 10, 40, 33, 51, 87, 9, 15, 22, 25 ); $t = &max( @tt ); print $t;
sub max { @test = @_; @test = reverse sort {$a <=> $b} @test; $t = $test[0]; }
¹°¾îº¸½Ã±â Àü¿¡ Ã¥À» ã¾Æº¸½Ã¸é ¸ðµÎ ³ª¿ÍÀÖ½À´Ï´Ù. 7¹øÀº Çؽ¬¿¡ °üÇؼ º¸½Ã±¸¿ä. (key ¿Í value) 8¹øÀº ¹®ÀÚ,¼ýÀÚ ¼ÒÆÿ¡ °üÇÑ ¹®Á¦ÀÎ°Í °°³×¿ä. µµ¿òÀÌ µÇ¾úÀ¸¸é ÁÁ°Ú³×¿ä.
|