Template-Toolkitï¼ä»¥ä¸TTï¼ã§ã® ä¸è¬çãªã«ã¼ãã®ããæ¹ã¯ ======================================== [%FOREACH value=loop%] ãååã¯ï¼[%value.name%]ã§ãã [%END%] ======================================== ãã®ã«ã¼ãã®ã«ã¼ãåæ°ãå©ç¨ãã¦ä½ãå¦çããããå ´åã¯äºç´ãªãã¸ã§ã¯ããloopãã¨ããã®ã使ç¨ã§ããã ======================================== ãloop.sizeãããªã¹ãã®è¦ç´ æ° ãloop.maxããæå¾ã®è¦ç´ ã®ã¤ã³ããã¯ã¹ (size - 1) ãloop.indexãã0ããmax()ã®ãã¡ã®ãç¾å¨ã®ç¹°ãè¿ãå¦çã®ã¤ã³ããã¯ã¹ ãloop.countãã1ããsize()ã®ãã¡ã®ãç¾å¨ã®ç¹°ãè¿ã
è¤æ°ã®ããã»ã¹ã§ããã¯ç¶æ ãç°å¸¸ã§ããã¨å¤æãï¼ãã®ãã¡ã® 1ã¤ãããã¯ã解é¤ãããã¨ã«ããï¼å¥ã®ããã»ã¹ãããã¯ããã«ãã ããããï¼å ã»ã©ããã¯ç¶æ ãç°å¸¸ã§ããã¨å¤æããããã»ã¹ã«ãã£ã¦ãã®æ£å¸¸ãªãã ã¯ã解é¤ããã¦ãã¾ãå¯è½æ§ãããã¾ãï¼ ãã®æ¹æ³ã®åé¡ç¹ã¯ï¼ç°å¸¸ãªããã¯ç¶æ ã解é¤ããæä½ãæ£å¸¸ãªããã¯ç¶æ ãã 解é¤ã§ãã¦ãã¾ããã¨ã«ããã¾ãï¼éã«è¨ãã°ï¼ç°å¸¸ãªããã¯ç¶æ ã解é¤ããæä½ã« ãã£ã¦æ£å¸¸ãªããã¯ç¶æ ã解é¤ã§ããªããã°åé¡ãªãããã§ãï¼ãã®ããã«ã¯ã©ãã ãã°ããã®ãï¼ çãã¯ããã¯ç¶æ ã常ã«å¤åãã¦ããã° ããã¨ãããã¨ã§ãï¼ããã¦ï¼ãããå®ç¾ããã®ã«é½åãããã®ã rename ã«ããæ¹æ³ã«ãªãã¾ãï¼ æåã®ã¹ã¯ãªããã§èª¬æãã¾ãã¨ï¼ããã¯ãã¡ã¤ã«ã lockfile ã¨ãã ååã®ã¨ããããã¯ã解é¤ããã¦ããç¶æ ã§ï¼lockfile987654321 ã®ãã ã«å¾ãã«
å¤æ°ã¯ä»¥ä¸ã®ããã«å¤ãä»£å ¥ãããåºåãããã¨ãã§ãã¾ãã # å¤æ°ã«æååãä»£å ¥ $value = "ãã¹ãã§ã"; # å¤æ°ãåºå print $value; ãåç §ãã¼ã¸ã å¤æ° é å è¤æ°ã®å¤ã1ã¤ã®å¤æ°ã§ç®¡çãããå ´åã¯ããé åãã¨ããå¤æ°ãæé©ã§ãã é åãåæåããå ´åã¯ï½¤è¦ç´ ãã«ãã³ã§å²ã¿ï½¤åè¦ç´ æ¯ã«ã«ã³ãã§åºåãã¾ã。 @week = ('æ¥æ', 'ææ', 'ç«æ', 'æ°´æ', 'æ¨æ', 'éæ', 'åæ'); é åã¯ã¤ã³ããã¯ã¹ã使ã£ã¦åç §ãã¾ããã¤ã³ããã¯ã¹ã¯ 0ããå§ã¾ãã®ã§æ³¨æãã¦ãã ããããã¨ãã°1çªç®ã®ãã¼ã¿ "æ¥æ" ãå¼ã³åºãã¨ãã¯ã$week[0]ã"ææ"ãªã $week[1] ã¨ãã¾ãã # é å @week ã®1çªç®ã®è¦ç´ ã表示 print $week[0], "\n"; > æ¥æ # é å @week ã®2çªç®ã®è¦ç´ ã表示 print $
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}