UltraEdit编辑器下面运下面的PERL脚本,如何修改可以得到运行结果
1#!/usr/bin/perl2#3#UsingArrayreferences4#5$pointer=@ARGV;6printf"\nPointerAddressofA...
1#!/usr/bin/perl
2 #
3 # Using Array references
4 #
5 $pointer = @ARGV;
6 printf "\n Pointer Address of ARGV = $pointer\n";
7 $i = scalar(@$pointer);
8 printf "\n Number of arguments : $i \n";
9 $i = 0;
10 foreach (@$pointer) {
11 printf "$i : $$pointer[$i++]; n";
12 }
运行结果如下:
$ test 1 2 3 4
Pointer Address of ARGV = ARRAY(0x806c378)
Number of arguments : 4
0 : 1;
1 : 2;
2 : 3;
3 : 4; 展开
2 #
3 # Using Array references
4 #
5 $pointer = @ARGV;
6 printf "\n Pointer Address of ARGV = $pointer\n";
7 $i = scalar(@$pointer);
8 printf "\n Number of arguments : $i \n";
9 $i = 0;
10 foreach (@$pointer) {
11 printf "$i : $$pointer[$i++]; n";
12 }
运行结果如下:
$ test 1 2 3 4
Pointer Address of ARGV = ARRAY(0x806c378)
Number of arguments : 4
0 : 1;
1 : 2;
2 : 3;
3 : 4; 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询