CGI :: Simple.

CGI :: SimpleÀº CGI.PM ȣȯµÇ´Â °£´ÜÇÑ OO CGI ÀÎÅÍÆäÀ̽ºÀÔ´Ï´Ù.
Áö±Ý ´Ù¿î·Îµå

CGI :: Simple. ¼øÀ§ ¹× ¿ä¾à

±¤°í

  • Rating:
  • ƯÇã:
  • Perl Artistic License
  • °¡°Ý:
  • FREE
  • °Ô½ÃÀÚ À̸§:
  • Andy Armstrong
  • °Ô½ÃÀÚ À¥»çÀÌÆ®:
  • http://search.cpan.org/~andya/

CGI :: Simple. ű×


CGI :: Simple. ¼³¸í

CGI :: SimpleÀº CGI.PMÀ» ÁؼöÇÏ´Â °£´ÜÇÑ OO CGI ÀÎÅÍÆäÀ̽ºÀÔ´Ï´Ù. CGI :: SimpleÀº CGI.PM Compliant.Synopsis CGI :: SimpleÀ» »ç¿ëÇÏ´Â °£´ÜÇÑ OO CGI ÀÎÅÍÆäÀ̽ºÀÔ´Ï´Ù. $ cgi :: simple :: post_max = 1024; # POST DEFAULT 100KB $ CGI¸¦ ÅëÇÑ ÃÖ´ë ¾÷·Îµå :: SIMPLE :: Disable_Uploads = 0; # UPLOADS »ç¿ë $ Q = »õ CGI :: ´Ü¼ø; $ q = »õ CGI :: ´Ü¼ø ({ 'foo'=> '1', 'bar'=> }); $ q = »õ CGI :: ´Ü¼ø ( 'foo = 1bar = 2bar = 3bar = 4'); $ q = »õ CGI :: ´Ü¼ø (* FileHandle); $ Q-> ÀúÀå (* FileHandle); # »õ·Î¿î @params = $ q-> param¿¡¼­ »ç¿ëµÇ´Â °Íó·³ ÇöÀç ¿ÀºêÁ§Æ®¸¦ ÆÄÀÏ¿¡ ÀúÀåÇϽʽÿÀ. # ¸ðµç param À̸§À» ¸ñ·ÏÀ¸·Î ¹Ýȯ $ value = $ q-> param ( 'foo'); # 'foo'@values = $ q-> param ( 'foo')¿¡ Á¦°øµÈ ù ¹ø° °ªÀ» ¹ÝȯÇÕ´Ï´Ù. # foo % Çʵå = $ q-> vars¿¡ Á¦°øµÈ ¸ðµç °ªÀ» ¹ÝȯÇÕ´Ï´Ù. # untited Å° °ª ½Ö hash $ hash_ref = $ q-> vars¸¦ ¹ÝȯÇÕ´Ï´Ù. # ¶Ç´Â Çؽà ref % Çʵå = $ q-> vars ( "|"); # "|"·Î ¿©·¯ °ªÀ» ÆÑÇÕ´Ï´Ù. ""º¸´Ù´Â ¿ÀÈ÷·Á; @keywords = $ q-> Å°¿öµå; # ¸ðµç Å°¿öµå¸¦ ¸ñ·ÏÀ¸·Î ¸®ÅÏ $ q-> param ( 'foo', 'ÀϺÎ', '»õ·Î¿î', '°ª'); # »õ 'foo'°ª ¼³Á¤ $ q-> param (-name => foo ', -value => bar'); $ q-> param (-name => 'foo', -value => ); $ q-> param ( 'foo', 'ÀϺÎ', '»õ·Î¿î', '°ª'); # 'foo'$ q-> append (-name => 'foo', -value => bar ')¿¡ °ªÀ» Ãß°¡ÇϽʽÿÀ. $ q-> append (-name => 'foo', -value => ); $ q-> »èÁ¦ ( 'foo'); # param 'foo »èÁ¦ ¹× ¸ðµç °ª $ q-> delete_all; # $ FILES = $ Q-> ¾÷·Îµå () # ÆÄÀÏ ¼ö¸¦ ¾÷·Îµå ÇÑ @FILES = $ Q-> ¾÷·Îµå (); ¸ðµç ¾÷·Îµå µÈ ÆÄÀÏÀÇ À̸§ $ filename = $ q-> param ( 'upload_file') # ¾÷·Îµå µÈ ÆÄÀÏÀÇ ÆÄÀÏ À̸§ $ MIME = $ Q-> upload_info ($ filename, 'mime'); # ¾÷·Îµå µÈ ÆÄÀÏÀÇ MIME À¯Çü $ size = $ q-> upload_info ($ filename, 'size'); # ¾÷·Îµå µÈ ÆÄÀÏÀÇ Å©±â MY $ FH = $ Q-> ¾÷·Îµå ($ FILENAME); # {...} # ª°í ´ÞÄÞÇÑ ¾÷·Îµå $ OK = $ Q-> ¾÷·Îµå ($ Q-> param ( 'upload_file') ' / path/to/write/file.name '); "¾÷·Îµå"¸¦ ÀμâÇϽʽÿÀ. $ Q-> param ( 'upload_file') "."±×¸®°í ½è½À´Ï´Ù! " $ OK ÀÎ °æ¿ì; $ decoded = $ q-> URL_DECODE ($ ÀÎÄÚµù µÈ); $ encoded = $ q-> URL_ENCODE ($ noccoded); $ escaped = $ q-> compinehtml ( ' "'); $ unescaped = $ q-> unescapehtml ( '"'); $ qs = $ q-> query_string; # $ Q¿¡ $ QÀÇ ¸ðµç µ¥ÀÌÅÍ °¡Á® ¿À±â $ q-> no_cache (1)¿¡ ´ëÇÑ Äõ¸® ¹®ÀÚ¿­ È®ÀÎ; # pragma ¼³Á¤ : ¾Æ´Ï¿À ij½Ã + Àμâ $ q-> header (); # °£´ÜÇÑ ¸Ó¸®±Û Àμâ # º¹ÀâÇÑ Çì´õ °¡Á® ¿À±â $ header = $ q-> ¸Ó¸®±Û (-type => 'image / gif'-nph => 1, -status => '402 ÁöºÒ ÇÊ¿ä', - expires => '+ 24 ½Ã°£ ', -Cookie => $ cookie, -charset =>'UTF-7 ', -Attachment =>'foo.gif ', -cost =>'$ 2.00 '); # P3P Çì´õ (redirect »ç¿ë¿¡ ´ëÇÑ È®ÀÎ) $ header = $ q-> ¸Ó¸®±Û (-p3p => 'policyref = "http://somesite.com/p3p/policyreferences.xml); @cookies = $ q -> ÄíÅ° (); # ¸ðµç »ç¿ë °¡´ÉÇÑ ¸ðµç ÄíÅ°ÀÇ À̸§À» ¾òÀ¸½Ê½Ã¿À $ value = $ q-> ÄíÅ° ( 'foo') # ÄíÅ°ÀÇ Ã¹ ¹ø° °ªÀ» ¾òÀ¸½Ê½Ã¿À. 'foo'@value = $ q-> ÄíÅ° ( 'foo') # ÄíÅ° 'foo'# header () ¸Þ¼­µå ¿ëÀ¸·Î Æ÷¸Ë µÈ ÄíÅ° °¡Á® ¿À±â $ cookie = $ q-> ÄíÅ° (-name => password ', -values => , -Expires =>'+ 3d ', -domain =>'.nowerhere.com ', -path =>'/ cgi-bin / database ', -secure => 1); $ q-> Çì´õ¸¦ ÀμâÇϽʽÿÀ (-cookie => $ cookie); # ÄíÅ° Àμâ $ q-> ¸®µð·º¼Ç ( 'http://go.away.now'); # redirect Çì´õ Dienice ($ q-> cgi_error) Àμâ $ q-> CGI_ERROR; CGI :: SIMPLEÀº CGI.PMÀ» ´ëü ÇÒ ¼öÀÖ´Â »ó´ëÀûÀ¸·Î °æ·®ÀÇ µå·ÓÀ» Á¦°øÇÕ´Ï´Ù. ¸Å°³ º¯¼ö ±¸¹® ºÐ¼®, ÆÄÀÏ ¾÷·Îµå, ÄíÅ° ó¸® ¹× Çì´õ »ý¼ºÀ» À§ÇØ µ¿ÀÏÇÑ OO ÀÎÅÍÆäÀ̽º¸¦ CGI.PM¿¡ °øÀ¯ÇÕ´Ï´Ù.ÀÌ ¸ðµâÀº ¿ÏÀüÈ÷ °´Ã¼ ÁöÇâÀûÀÌÁö¸¸ ¿Ïº®ÇÑ ±â´É ÀÎÅÍÆäÀ̽º¸¦ »ç¿ëÇÒ ¼ö ÀÖ½À´Ï´Ù CGI :: SIMPLE :: Standard Module.sentially CGI (HTMLÀÌ ¾Æ´Ô) Ãø¸é¿¡ °ü·ÃµÇ´Â CGI.PMÀÇ ¸ðµç °ÍÀÌ °¡´ÉÇÕ´Ï´Ù. ¸î °¡Áö »õ·Î¿î ¹æ¹ý°ú ¿À·¡µÈ °Íµé¿¡ Ãß°¡°¡ ÀÖ½À´Ï´Ù! ÈÄµå ¾Æ·¡¿¡ °¬´ø °Í¿¡ °ü½ÉÀÌÀÖ´Â °æ¿ì End.in ½Ç¿ëÀûÀÎ Å×½ºÆ®¿¡¼­ CGI.PM ¼½¼Ç°úÀÇ È£È¯¼ºÀ» ÂüÁ¶ÇϽʽÿÀ.ÀÌ ¸ðµâÀº Á¤È®ÇÑ Task.Requirements¿¡ µû¶ó CGI.PM¸¸Å­ µÎ ¹è³ª »¡¸® ½ÇÇàµË´Ï´Ù. ¡¤ Perl ¿ä±¸ »çÇ× : ¡¤ Perl.


CGI :: Simple. °ü·Ã ¼ÒÇÁÆ®¿þ¾î