zoukankan      html  css  js  c++  java
  • 小骆驼 第二章 标量数据

    数字与字符串

    #!/usr/bin/envperl
    
    use strict;
    use warnings;
    
    
    ##加斜表示同一个数字
    
    my $number = 124567890;
    
    my $new_number = 1_2_3456_7890;
    
    print "$number = $new_number\n";
    
    
    ##不同进制的数字
    
    my $octal_number = 0017;
    
    my $hexadecimal_number = 0x0f;
    
    my $binary_number = 0b0000_1111;
    
    my $decimal_number = 15;
    
    print"$octal_number=$hexadecimal_number=$binary_number=$decimal_number\n";
    
    
    ##加入除ASCII以外字符时使用Unicode编码
    
    use utf8
    
    print "\x{2668}\n";
    
    
    ##关于大小括号显示空白,相同效果
    
    print "a b c\n";
    
    print 'a b c'."\n";
    
    
    ##little x
    
    print 5 x 4;
    
    print "\n";
    
    print 5 x 4.8;
    
    print "\n";
    
    
    ##multiplication
    
    print "12"*"3"."\n";
    
    print "12apple34" * "3"."\n";
    
    
    ##warning details
    
    use diagnostics
    
    
    ##
    

    result
    Wide character in print at test.pl line 33.

    124567890 = 1234567890
    15=15=15=15
    a b c
    a b c
    5555
    5555
    36
    Argument “12apple34” isn’t numeric in multiplication (*) at test.pl line 58 (#1)
    (W numeric) The indicated string was fed as an argument to an operator
    that expected a numeric value instead. If you’re fortunate the message
    will identify which operator was so unfortunate.

    Note that for the Inf and NaN (infinity and not-a-number) the
    definition of "numeric" is somewhat unusual: the strings themselves
    (like "Inf") are considered numeric, and anything following them is
    considered non-numeric.
    

    36

  • 相关阅读:
    SDK安装教程
    appscan下载
    app测试-兼容性测试与云测试技术
    app测试之耗电量测试
    App测试1-App测试概述
    app测试2--monkey稳定性测试
    app测试1--常用adb命令
    常用dos命令
    jmeter(二)脚本录制
    jmeter基础介绍
  • 原文地址:https://www.cnblogs.com/yuanjingnan/p/11061489.html
Copyright © 2011-2022 走看看