Perl¤ÎÀâÌÀ¡¡¡¡¡¡¡¡¡¡ 1.»»½Ñ±é»»¡¡¡¡ 2.ÏÀÍý±é»»

¡¡£´. »»½ÑŽ¥ÏÀÍý±é»»¤Ë¤Ä¤¤¤ÆÀâÌÀ¤·¤Þ¤¹¡£



¡¡1.»»½Ñ±é»»

µ­½Ò¡¡Îã
$i = $i + 1; $i = $i - 1; $i = $i * 2; $i = $i / 3; $i = $i % 3; $i = $i ** 3 $i += 1; $i -= 1; $i *= 2; $i /= 3; $i %= 3; $i **= 3; 1 ¤ò²Ã»»¡¡¡¡$i++; 1 ¤ò¸º»»¡¡¡¡$i--; 2 ¤Ç¾è»» 3 ¤Ç½ü»» $i=5 ¤À¤È 1.66666666666667 3 ¤Ç½ü»»¤·¤¿Í¾¤ê 3 ¾è
µ­½Ò¡¡Îã
print 1+2,"\n"; $x = 3; $y = 7; print $x+$y,"\n" $k = 2.1*10**2; print $k,"\n" $a = int( 5 / 3 ); $a = int( 5 / 3 + 0.5); $a = 4 ** 0.5; # 3 ¤òɽ¼¨ # 10 ¤òɽ¼¨ # 2100 ¤òɽ¼¨ # 1 ¾¯¿ôÅÀ°Ê²¼¤òÀÚ¤ê¼Î¤Æ¤ë # 2 ¾¯¿ôÅÀ°Ê²¼»Í¼Î¸ÞÆþ # ¥ë¡¼¥È[Ê¿Êýº¬]¡¡ $a = 2
±é»»»Ò ÆâÍÆ ++ ¥¤¥ó¥¯¥ê¥á¥ó¥È -- ¥Ç¥¯¥ê¥á¥ó¥È ** »Ø¿ô(¤Ù¤­¾è)±é»» * ¾è»» / ¼Â¿ô¤Î½ü»» % À°¿ô¤Î¾ê;(;¤ê) +,- ²Ã»»,¸º»» - Éé¹æ
¢¨ÊÑ¿ô¡¢Äê¿ô¡¢±é»»»Ò¤È¤Î´Ö¤Ë¤Ë¥Ö¥é¥ó¥¯¤¬¤¢¤Ã¤Æ¤â¤Ê¤¯¤Æ¤â¤«¤Þ¤¤¤Þ¤»¤ó¡£



¡¡2.ÏÀÍý±é»»


µ­½Ò¡¡Îã
! ~ << >> & | ^ && || ÏÀÍýÈÝÄê ¥Ó¥Ã¥ÈÈÝÄê ¥Ó¥Ã¥È¥·¥Õ¥È ¥Ó¥Ã¥È¥·¥Õ¥È ¥Ó¥Ã¥ÈÏÀÍýÀÑ ¥Ó¥Ã¥ÈÏÀÍýÏ ¥Ó¥Ã¥ÈÇÓ¾ŪÏÀÍýÏ ÏÀÍýÀÑ ÏÀÍýÏ !$x ~$x <<$x >>$x $x & $y $x | $y $x ^ $y $x && $y $x || $y
µ­½Ò¡¡Îã
if( $a == 10 && $b > 20 ){...} if( $str =~ /abc/ && $str =~ /xyz/ ) if( $str =~ /abc/ || $str =~ /xyz/ ) if( ( $a > 80 && $b <= 60 ) || ( $a <=30 && $b > 60 ) ){...} unless( $a == 10 && $b > 30 ){...} if( ! ( $a == 10 && $b > 30 ) ){...} # $a ¤¬ 10 ¤«¤Ä $b > 20 ¤Î¤È¤­¡¢¿¿{...} # ÊÑ¿ô$str ¤Ë abc ¤«¤Ä xyz ¤¬¤¢¤ë¤È¤­¿¿ # ÊÑ¿ô$str ¤Ë abc Ëô¤Ï xyz ¤¬¤¢¤ë¤È¤­¿¿ # ( $a > 80 ¤«¤Ä $b <= 60 ) Ëô¤Ï # ( $a <= 80 ¤«¤Ä $b > 60 ) ¤Î¤È¤­¡¢¿¿ # ifʸ¤Î¾ò·ï¤ò¤Ò¤Ã¤¯¤êÊÖ¤¹ÊýË¡ # Ʊ¾å¡¢Æ±¤¸°ÕÌ£




1.»»½Ñ±é»»¡¡¡¡ 2.ÏÀÍý±é»»¡¡¡¡¡¡¡¡ [ Top ]