Perl 5.22ããªãªã¼ã¹ããã¾ãã - æ°å¦é¢é£ã®æ©è½å¼·åãã¡ã½ããã®ããã©ã¼ãã³ã¹ã®æ¹åãæ£è¦è¡¨ç¾ã®æ¹å
Perl
›
ãã¼ã¸ã§ã³æ å ±
›
here
ã2015å¹´6æ1æ¥ã«ãææ°ãã¼ã¸ã§ã³ã®Perl 5.22ããªãªã¼ã¹ããã¾ããã
ãä»åã®ãªãªã¼ã¹ã§ã¯ãæ´»çºãªæ©è½è¿½å ãè¡ããã¦ãã¾ãã
ããã©ã¼ãã³ã¹ã®æ¹å
ãPerl 5.22ã®ä¸çªããããªç¹ã¯ãæ§è½æ¹åã§ãããã«ãããªãã¡ã¬ã³ã¹ã®æ§æ解æã¨ã¡ã½ããã®æ§æ解æã®æ¹åã«ãã£ã¦ãããã©ã¼ãã³ã¹ãã¢ãããã¦ãã¾ãã
è¤æ°é層ã®ããªãã¡ã¬ã³ã¹ã®æ§è½æ¹å
ãPerlã®å é¨ãã¼ãµã¼ã¯ãè¤æ°é層ã®ããªãã¡ã¬ã³ã¹ãå¹ççã«è§£æã§ããããã«ãªãã¾ããããã®ããã«ãè¤æ°é層ã®ããªãã¡ã¬ã³ã¹ã®ããã©ã¼ãã³ã¹ãä¸æãã¦ãã¾ãã
$scores->[0]{math};
ã¡ã½ããå¼ã³åºãã¨SUPERæ¬ä¼¼ã¯ã©ã¹ã®æ§è½æ¹å
ãã¡ã½ããå¼ã³åºãã¨ãSUPERæ¬ä¼¼ã¯ã©ã¹ã¯ãäºåã«è§£æããããã®æ å ±ããã£ãã·ã¥ãããããã«ãªã£ã¦ãã¾ãããã®ãããå®è¡æã®ãã¡ã½ããå¼ã³åºãã®ããã©ã¼ãã³ã¹ãä¸æãã¦ãã¾ãã
$obj->method $obj->SUPER::method;
lengthé¢æ°ã®æ§è½æ¹å
ãlengthé¢æ°ã¯ãUTF-8ã§ã¯ãªãæååã«é¢ãã¦20%ããã©ã¼ãã³ã¹ãã¢ãããã¦ãã¾ãã
é åã¨ããã·ã¥ã®æ§è½æ¹å
ããã¼ããå®æ°ããåç´ãªå¤æ°ã ã£ãå ´åã«ãé åã¨ããã·ã¥ã®è¦ç´ ã¸ã®ã¢ã¯ã»ã¹ãéããªã£ã¦ãã¾ãã
Perl 5.22ã®æ©è½ã®è¿½å
ãPerl 5.22ã§ã¯ãæ°å¦é¢é£ã®æ©è½ã®æ¹åãªã©ãè¡ããã¦ãã¾ãã
C99ã®æ°å¦é¢æ°ãå©ç¨ã§ããããã«ãªãã¾ãã
ãPerlã§C99ã§ãµãã¼ãããã¦ããæ°å¦é¢æ°ããPOSIXã¢ã¸ã¥ã¼ã«ãéãã¦å©ç¨ã§ããããã«ãªãã¾ããã
atanh tgamma
ç¡éã¨NaN(æ°å¤ã§ãªã)ã®æ±ãã®æ¹å
ãInfã¨NaNãããå
åºã«å©ç¨ã§ããããã«ãªãã¾ããã
16é²ã®æµ®åå°æ°ç¹ã®è§£æãåä¸ãã¾ãã
ã16é²ã®æµ®åå°æ°ç¹ã®è§£æãåä¸ãã¾ãããã¾ãã16é²ã§æµ®åå°æ°ç¹ãè¨è¿°ãããªãã©ã«ã追å ããã¦ãã¾ãã
0x1.23p-4
ãããã§ãPerlã¬ãã«ã§ããã·ã³ã¬ãã«ã¨èª¤å·®ã®ãªãæ°å¤ã表ç¾ãããã¨ãå¯è½ã«ãªã£ã¦ãã¾ãã
ããã®ããã«Perl 5.22ã§ã¯ãæ°å¦é¢é£ã®æ©è½ãããªãæ¹åããã¦ãã¾ãã
é常ã®æ¬å¼§ããã£ããã£ã«å©ç¨ããªããã©ã°
ãPerl 5.22ã§ã¯ã正規表現ã®æ°ãããã©ã°ã¨ãã¦ãé常ã®æ¬å¼§ããã£ããã£ã«å©ç¨ããªããã©ã°ã追å ããã¾ãããããã«ãã£ã¦ãè¤éãªæ£è¦è¡¨ç¾ãæ¸ãã¨ãã«ããã£ããã£ããªãæ¬å¼§ã(?:)ãã使ããªãã§ãç°¡æ½ã«è¨è¿°ãããã¨ãã§ããããã«ãªãã¾ããã
"hello" =~ /(hi|hello)/n
ãæ¬å¼§ã使ã£ã¦ãã¾ããããã®æ¬å¼§ã¯ãã£ããã£ãã¾ãããnãªãã·ã§ã³ã使ã£ãå ´åã«ããã£ããã£ããããå ´åã¯ã次ã®ããã«ãã¾ãã
"hello" =~ /(?-n:(hi|hello))/n; # $1 㯠"hello" "hello" =~ /(?<greet>hi|hello)/n; # $1 㯠"hello", $+{greet} ã "hello"
ãè¤éãªæ£è¦è¡¨ç¾ãæ¸ãã¨ãã¯ãnãªãã·ã§ã³ã¨ãååã¤ããã£ããã£ã¨çµã¿åãããã¨è¦ãããã®ã§ã¯ãªãã§ããããã
Unicode 7.0ã®ãµãã¼ã
ãPerl 5.22ã§ã¯Unicode 7.0ããµãã¼ãããã¾ãããUnicodeã®ãµãã¼ã対å¿ã¯Perlã¯ã¨ã¦ãæ©ãã§ãã
ãªãã¡ã¬ã³ã¹ãéããã¨ã¤ãªã¢ã¹
ãPerlã®æ©è½ã¨ãã¦ã¨ã¤ãªã¢ã¹ã¨ããæ©è½ãåå¨ãã¦ããã®ã§ããããããæ§æã¬ãã«ã§å¼ã³åºããããã«ãªãã¾ããããã®æ©è½ã¯å®é¨çã§ãã
use experimental::refaliasing; my $nums = [1, 2, 3]; my $nums_alias; \$nums_alias = \$nums;
å®æ°é¢æ°ã®ãµãã¼ã
ãconstãµãã«ã¼ãã³å±æ§ã«ãã£ã¦ãå®æ°é¢æ°ããµãã¼ãããã¾ãããé¢æ°ã¯ä¸åº¦å®å¹ãããã¨ãã®å¤ã¯ä¿åããã2åç®ä»¥éã¯ããã®å¤ãå©ç¨ãã¾ãããã®æ©è½ã¯å®é¨çã§ãã
my $value = sub : const { 100 * 100 };
ããã«ãã¤ã¤ã¢ã³ããªãã¬ã¼ã¿ã¼ - ããå®å ¨ãªãã¤ã¤ã¢ã³ããªãã¬ã¼ã¿ã¼
ãããå®å ¨ãªããã«ãã¤ã¤ã¢ã³ããªãã¬ã¼ã¿ã¼ã<<>>ãããµãã¼ãããã¾ãããå¾æ¥ã®ãã¤ã¤ã¢ã³ããªãã¬ã¼ã¿ã¼ã¯ãäºå¼æ°ã®opené¢æ°ãå é¨çã«å©ç¨ãã¦ãã¾ããããããã«ãã¤ã¤ã¢ã³ããªãã¬ã¼ã¿ã¼ã¯ãä¸å¼æ°ã®opené¢æ°ãå©ç¨ãã¾ãã
my $line = <<>>;
encodingã¢ã¸ã¥ã¼ã«ãã¬ãã·ã«ã«ã¹ã³ã¼ããæã¤ããã«ãªãã¾ãã
ãencodingã¢ã¸ã¥ã¼ã«ã¯éæ¨å¥¨ãªã¢ã¸ã¥ã¼ã«ã§ãããã¾ã çåæéä¸ã§ããããã§ãæ©è½ã®æ¹åã¨ãã¦encodingãå©ç¨ããã¨ãã®å½±é¿ã®ç¯å²ããã°ãã¼ãã«ãªãã®ãããã¬ãã·ã«ã«ãªãã®ã«ãªã£ã¦ãã¾ããencodingã¢ã¸ã¥ã¼ã«ãããã¡ã¤ã«åä½ãªã©ã§ãé¨åçã«å©ç¨ã§ããããã«ãªãã¾ããã
éæ¨å¥¨ã«ãªã£ãæ©è½
è¦åããã¹ã¦è´å½çãªã¨ã©ã¼ã«å¤æãããã¨ã¯ãéæ¨å¥¨ã¨ãªãã¾ããã
ãè¦åããã¹ã¦è´å½çãªã¨ã©ã¼ã«ããè¨è¿°ã¯ãéæ¨å¥¨ã¨ãªãã¾ããã次ã®è¨è¿°ã¯ãä»å¾ã¯ãéæ¨å¥¨ã§ãã®ã§ãé¿ãã¾ãããã
use warnings FATAL => 'all';
ãããã¯ãPerlã®ã³ã¢ãæ°ããè¦åã追å ããã¨ãã«ããã®ããã«ãä»ã¾ã§åãã¦ããã¢ããªã±ã¼ã·ã§ã³ããã¨ã©ã¼ã«ãã£ã¦ã¨ã¾ã£ã¦ãã¾ãã¨ãããªã¹ã¯ãããããã§ããPerlã®ã³ã¢ãã¼ã ããå®å ¨ãªäºææ§ã§ã¯ãªããæ°ããè¦åãå®å ¨ã«è¿½å ã§ããã»ããé¸æããããã§ããåããããã«ã¯ãè³æã§ãã
éäºæãªå¤æ´
ã次ã®è¨è¿°ãã¨ã©ã¼ã«ãªãã¾ããã
defined(@array) defined(%hash)
ããã®è¨è¿°ã¯5.6.1ã®æç¹ã§ãå»æ¢äºå®ã¨ãªã£ã¦ããã5.16ã§ãå»æ¢äºå®ã®è¦åãçºããããããã«ãªã£ã¦ãã¾ãããã5.22ã§ãã¨ã©ã¼ã¨ãªãã¾ãããPerlããã¼ã¸ã§ã³ã¢ããããã¨ãã¯ãå¤ãã½ã¼ã¹ã³ã¼ãã«ã¯ããã®è¨è¿°ãããå¯è½æ§ãããã¾ãã®ã§ã注æãã¦ãã ããã
ã³ã¢ããã¯ãããã¢ã¸ã¥ã¼ã«
CGIã¢ã¸ã¥ã¼ã«ãã³ã¢ããã¯ããã¾ãã
ãCGIã¢ã¸ã¥ã¼ã«ãã³ã¢ããã¯ããã¾ãããããã¯é©ããããããããã¾ããããæ代ã®æµãã§ãããã¾ãã以å¾ã¯ãCPANãããã¤ã³ã¹ãã¼ã«ãã¦ãå©ç¨ãã¦ãã ããã
ãç¾å¨ã§ã¯ãWebãã¬ã¼ã ã¯ã¼ã¯ãå©ç¨ãã¦ãWebã¢ããªã±ã¼ã·ã§ã³ãéçºãããã¨ã主æµã«ãªã£ã¦ãã¾ãã以ä¸ã®ãã¼ã¸ãããWebéçºã«å¿ è¦ãªãã¬ã¼ã ã¯ã¼ã¯ãæ¢ããã¨ãã§ãã¾ãã
Module::Buildãã³ã¢ããã¯ããã¾ãã
ãModule::Buildãã³ã¢ããã¯ãããã¾ãããModule::Buildãå¿ è¦ãªã¨ãã¯ãèªåçã«CPANããã¤ã³ã¹ãã¼ã«ãããä»çµã¿ãPerlã«ã¯ãåå¨ããã¨ãããã¨ã¨ãã³ã¢ã®ç®¡çããªãã¹ãå°ããããã¨ããç®çã®ããã¯ãããã¾ããã
ã¾ã¨ã
ãææ³ãè¿°ã¹ãã¨ãã¾ãPerlãæ°å¦é¢é£ã®æ©è½ãå¼·åãããã¨ã«å¥½æãæã¦ã¾ããPerlãé ãã¦ããåéãã«ãã¼ããæ©è½è¿½å ãè¡ãããã®ã¯ããããããã¨ã§ãã
ãã¾ããã¡ã½ããã¨è¤æ°é層ã®ããªãã¡ã¬ã³ã¹ã®ããã©ã¼ãã³ã¹ãã¢ããããã®ã¯ãã¨ã¦ããããã¨ã ã¨æãã¾ãããã¨ãã°ãPerlã®Webãã¬ã¼ã ã¯ã¼ã¯ã®Mojoliciousã§ã¯ãPerl5.22ã«ãã¼ã¸ã§ã³ã¢ããããã¨ã20%以ä¸ã®ããã©ã¼ãã³ã¹ã®æ¹åããã£ãã¨ãããã¨ããå ±åããã¦ãã¾ããã
ãã¾ããããããã®ã¯ãè¦åãè´å½çãªã¨ã©ã¼ã«å¤æãããã¨ãéæ¨å¥¨ã«ãªã£ããã¨ã«ãã£ã¦ããuse warningsãããuse v5.xxãã¨ããã¨ãã«ãå ãããã¨ãã§ããå¯è½æ§ã®éãéãããã¨ã§ããæ©ãã®æ¹é転æããå¾ã ã®æ©è½æ¹åã«å©ãã¦ãã¾ãã®ã§ã
Perl
›
ãã¼ã¸ã§ã³æ å ±
›
here