æéIPã¢ãã¬ã¹ãããç ä¿®ä¼ - JPerl Advent Calendar 2009 Perl ã«é¢ããã¡ãã£ã¨ãã Tips ãã®ã£ãã¦ã¿ãããã¡ããã¨ç¶ãããªï¼ ãããã2010å¹´ã«ãªãããã§ãããæºå¸¯ã®ãµã¤ããªã©ã§ã¢ã¯ã»ã¹å ã®IPã¢ãã¬ã¹ããã£ãªã¢ã®IPã¢ãã¬ã¹å¸¯åå ã«ãããã©ããã確èªããããããã¨ãããã¨æãã¾ãã ä¾ãã°ããã¼ã«ã«ãããã¯ã¼ã¯ã®ã¢ãã¬ã¹(192.168.1.0/24)ã«ããããããã©ãã $env->{REMOTE_ADDR} =~ s/^192\.168\.1\.(?:\d+)$/ ãªãã¦æ¸ããã¨ãããã¨æãã¾ããããã§ããããã¼ã«ã«ã®ã¢ãã¬ã¹ã®ãããª/24ã®IPã¢ãã¬ã¹å¸¯åã§ããã°ç°¡åã«æ£è¦è¡¨ç¾ãæ¸ããã¨ãå¯è½ã§ããã/25, /26 /23ã/22ãªã©ã®CIDRã¯æ£è¦è¡¨ç¾ã§è¡¨ããã¨ã¯ãªããªãé£ããã§ãã ã¾ããæºå¸¯ãã£ãªã¢ã®ã¢ãã¬ã¹ã§ãããã¨ã確èªããã
{{#tags}}- {{label}}
{{/tags}}