Tag:Multidimensional Array

  • Instance code for initialization of Perl constants, multidimensional arrays and variables

    Time:2019-8-20

    Example 1: Copy codeThe code is as follows: #!/usr/bin/perluse strict; use warnings;my $test = “asdf”;print “${test}_test2\n”;#constantuse constant {    AAA => “aaa”,    BBB=> “bbb”,    MIN_TOTAL => 12,    SCORE_PASS => 90,    SCORE_RED => 70,};print AAA;print SCORE_PASS;#two dimesion arraysmy @steps = (      [“aaa”, “aaavalue”],      [“bbb”,”bbbvalue”],      [“ccc”,”cccvalue”]);print “\n”;foreach my $i (0 .. $#steps){  print “$steps[$i][0]:$steps[$i][1]\n”;} Code 2: Copy codeThe […]