[root@localhost ~]# less test #!/usr/bin/env perluse strict;use warnings;my $name = Fred;print "hello\n" if $name =~ /red/;[root@localhost ~]# ./test Bareword "Fred" not allowed wh
输入百家姓后回车,得到百家姓的排列的数字,目前支持赵钱孙李周吴郑王。 #!/usr/bin/perl chomp ($c = <STDIN>); 定义变量c从键
#!/usr/bin/perl $maximum = &max (3, 4, 8, 20, 9, 32, 12, 22); 传标量列表给子程序max sub max {  
foreach 省略了控制变量,Perl就使用他的老地方变量$_代替。 [root@Master perl]# less LaoDiFang.pl #!/usr/bin/perl foreach (1..10) { print "I can count to $_!\n"; } [root@Master perl]# perl LaoDiFang.p
Copyright © 2005-2025 51CTO.COM 版权所有 京ICP证060544号