予告ãããµãã«ã¼ãã³ã®å¼ã³åºãæ¹ã®è¬ã§ãã
ããããäºåããå²ãã«ã¯ãä¸æãã¾ã¨ã¾ããªãã£ãã®ã§ãã・・・以ä¸ã®ããã«ãªãã¾ããã
â ã¤ã³ãã
ã¾ããPerlã§ã®ãµãã«ã¼ãã³ã¯é¢æ°ã¨ç価ã§ãã
ããã¦ãé¢æ°ã®å¼ã³åºãæ¹ã«ã¯ãã&ãã®ãã¡ãã¼æåãä»ããããä»ããªãã£ãã・・・ã
ã¾ããé¢æ°åã®å¾ã«ã()ãå°ã«ãã³ãä»ããããä»ããªãã£ãã・・・ã
ã¾ãã¾ããã&ããã()ããä»ããªãããã¢ã¯ã¼ãã«ãªã£ããã¨ï½¥ï½¥ï½¥ã
ãããã¯ããçµã¿è¾¼ã¿é¢æ°ãã¤ã³ãã¼ãããã¢ã¸ã¥ã¼ã«é¢æ°ãã¨ãã¦ã¼ã¶å®ç¾©é¢æ°ãã§æå³ãéã£ã¦ãã¾ãã
ãªã®ã§ãåã
ã«ã¤ãã¦å¯¾æ¯ãã¦è§£èª¬ããã¦ã¿ã¾ããã
å°ã以ä¸ã¯ãããã¾ã§ãç§ã®ã³ã¼ãã£ã³ã°æ¹éã§ãå¼·å¶çãªãã®ã§ã¯ããã¾ããã
â ã&ããã¡ãã¼æåã«ã¤ãã¦
çµã¿è¾¼ã¿é¢æ°ãã¤ã³ãã¼ãããã¢ã¸ã¥ã¼ã«é¢æ°ã¯ãã&ããã¡ãã¼æåã¯ä»ããªãã
çµã¿è¾¼ã¿é¢æ°çã«ã&ããä»ããã¨ã¨ã©ã¼ã«ãªããï¼ã¦ã¼ã¶å®ç¾©é¢æ°ãæ¢ãã«è¡ã£ã¦ã¨ã©ã¼ã¨ãªãï¼
ã¦ã¼ã¶ãå®ç¾©ã§ããé¢æ°ï¼ãµãã«ã¼ãã³ï¼ã¯ãã&ããä»ããæ¹ãããã
ããã¯ãã¦ã¼ã¶å®ç¾©é¢æ°ã§ãã&ããä»ããªãã§å¼ã³åºãã¾ãããååã®çµã¿è¾¼ã¿é¢æ°çãããå ´åãçµã¿è¾¼ã¿é¢æ°ãåªå
ãããã¦ã¼ã¶å®ç¾©é¢æ°ã¯ç¡è¦ããã¾ãããªã®ã§ã¦ã¼ã¶å®ç¾©é¢æ°ã¯ã&ããä»ããæ¹ãããã
ãããããªçç±ã§ã&ããä»ãããã¦ã¼ã¶å®ç¾©é¢æ°ã¯é¢æ°åã®å¾ã«ã()ãå°ã«ãã³ãä»ããæ¹ãããã
ããããä¸ãä¸ãçµã¿è¾¼ã¿é¢æ°ã¨ã¦ã¼ã¶å®ç¾©é¢æ°ãååã«ãªã£ãæã¯ãã&ãã§ã¦ã¼ã¶å®ç¾©é¢æ°ãå¼ã³åºããã¨ãã§ããã
use strict; use warnings; my $hoge1 = time; # çµã¿è¾¼ã¿é¢æ° my $hoge2 = &time; # ã¦ã¼ã¶å®ç¾©é¢æ° print $hoge1 , "\n"; print $hoge2 , "\n"; sub time { return 'hoge'; }
â é¢æ°åã®å¾ã®ã()ãå°ã«ãã³ã«ã¤ãã¦
çµã¿è¾¼ã¿é¢æ°ãã¤ã³ãã¼ãããã¢ã¸ã¥ã¼ã«é¢æ°ã¯ãã()ãå°ã«ãã³ãä»ããªãæ¹ãããã
ã«ãã³ãä»ãã¦ãOKã§ãããã¦ã¼ã¶å®ç¾©é¢æ°ä»¥å¤ã§ãããã¨ãæ示ããããã«ã()ããä»ããªãæ¹ãããã
ã¦ã¼ã¶ãå®ç¾©ã§ããé¢æ°ï¼ãµãã«ã¼ãã³ï¼ã¯ãã()ãå°ã«ãã³ãä»ããã
é¢æ°ããã¸ãã¯ã®åç½®ãã«å®ç¾©ããã¨ãã«ãã³ãªãã§ãOKã§ãããããããªããã()ãå°ã«ãã³ãä»ãã¦ã¦ã¼ã¶å®ç¾©é¢æ°ãæ示ããã
use strict; use warnings; my $hoge1 = localtime time; # çµã¿è¾¼ã¿é¢æ° my $hoge2 = &localtime(time); # ã¦ã¼ã¶å®ç¾©é¢æ° print $hoge1 , "\n"; print $hoge2 , "\n"; sub localtime { return $_[0]; }
â å¼æ°ã®ãªãé¢æ°ã«ã¤ãã¦
å¼æ°ã®ãªãå ´åã®çµã¿è¾¼ã¿é¢æ°ãã¤ã³ãã¼ãããã¢ã¸ã¥ã¼ã«é¢æ°ã¯ããã¢ã¯ã¼ãã«ããã
å¼æ°ã®ãªãå ´åã®ã¦ã¼ã¶ãå®ç¾©ã§ããé¢æ°ï¼ãµãã«ã¼ãã³ï¼ã¯ãã&ãã()ããä»ããæ¹ãããã
â ã¦ã¼ã¶å®ç¾©é¢æ°ã¯ãã&ããã¤ããªãï¼
åã«ãbingo_nakanishããã«ããµãã«ã¼ãã³ã®é ã«&ã¯æ®éã¤ããªããã¨æãã¦é ããã®ã§ãã・・・ã
- ãµãã«ã¼ãã³ã®é ã«&ã¯æ®éã¤ããªã
http://d.hatena.ne.jp/bingo_nakanishi_perl/20090618/1245326468
çµã¿è¾¼ã¿é¢æ°ã¨ååã®ã¦ã¼ã¶å®ç¾©é¢æ°ãå®ç¾©ããã¨ãã¯ãã©ããã¦ãã&ãä»ãã§ãªãã¨å¼ã³åºããªãã®ã§ãã
ã¾ããç¾å¨ãçµã¿è¾¼ã¿é¢æ°ã¨ååããªãã¦ã¼ã¶å®ç¾©é¢æ°ãä½ã£ã¦ã&ãç¡ãã§å¼ãã§ä¸æããã£ã¦ãã¦ããå°æ¥ãååã®çµã¿è¾¼ã¿é¢æ°ãåºæ¥ãå¯è½æ§ãããããã§ãã
ããã¨ãã¦ã¼ã¶å®ç¾©é¢æ°ã§ãªããçµã¿è¾¼ã¿é¢æ°ãå¼ã°ããããã«ãªããä¸ä½äºææ§ããªããªã・・・ã
ãªã®ã§ã¦ã¼ã¶å®ç¾©é¢æ°ã¯ãã&ããã¤ããã»ããããã¨æãã®ã§ããã©ãã§ããããï¼
ã&ãã¯ãåºæ¬çã«ã¤ãã¾ãããããã«é¢ãã¦ã¯ä»¥ä¸ã®ãªã³ã¯å ãåç §é¡ãã¾ãã
- & ã¯ãã¤ä½¿ãã¹ãã http://blog.livedoor.jp/dankogai/archives/51237271.html
- é¢æ°ã¨æ¼ç®å http://d.hatena.ne.jp/deq/20061213/1165991932
ã¾ããid:miyagawaæ°ããã以ä¸ã®ãããªã³ã¡ã³ããé ãã¾ããã
å°æ¥çµã¿è¾¼ã¿é¢æ°ãå¢ããå ´åã§ãããããã®é¢æ°ã¯ use feature ããªãã¨æå¹ã«ãªããªãä»çµã¿ã«ãªã£ã¦ãã(5.10ã®say ã givenãªã©) ã®ã§ãä½ããªãã«åããªããªããã¨ãããã¨ã¯ãªãã¯ãã
â çµè«
- çµã¿è¾¼ã¿é¢æ°ãã³ã¼ã«ããæã¯ãå°ã«ãã³ã()ããä»ããªãã
- ã¦ã¼ã¶å®ç¾©é¢æ°ãã³ã¼ã«ããæã¯ãå°ã«ãã³ã()ããä»ãããããããã&ãã¯ä»ããªãã
çµå±ãåã«bingo_nakanishããã«æãã¦é ããéãã§ããï¼^o^ï¼