åé¡ @a = (1,2,3); @b = (1,2,3); ã®ãããªé åããã£ãã¨ãã¦ããããã®ä¸èº«ãåã(@a = @b) ã§ãããã¨ã確èªãããã¨æãã¾ãã ç´°ããæ¡ä»¶ã¨ãã¦ãå¤ã¯æ£ã®æ°åã®ã¿(è² ã¯ãªãã)ã§ä¸¦ã³é ã¯æ°ã«ããªãããã¤åãçªå·ã¯ãªãã¨ããäºã«ãã¾ãã ããããã«èããã¨ã次ã®äºã¤ã®æ¡ä»¶ãæºãããã°ããã¯ãã§ãã äºã¤ã®è¦ç´ ã®æ°ãåãã§ããã㨠å é ããæ¯è¼ãã¦ãæ«å°¾ã¾ã§ã®åé ç®ã®å 容ãçãããã¨ ç´ ç´ã«ã³ã¼ãã£ã³ã°ããã¨... sub is_same($$){ my($a,$b) = @_; # (1)äºã¤ã®è¦ç´ ã®æ°ãåãã§ããã㨠return 0 if @$a != @$b; # (2)å é ããæ¯è¼ãã¦ãæ«å°¾ã¾ã§ã®å 容ãçããã㨠for (0..$#$a){ return 0 if $a->[$_] != $b->[$_]; } return 1; } ã¨ãããµã
{{#tags}}- {{label}}
{{/tags}}