输出到标准输出
ssssssssssss
ssssssssss
dddddddddddd
2222222222
sssssssssssssssss
#!/usr/bin/perl
use strict;
use warnings;
my @arr = (1,2,3,3);
print "@arr\n";
print @arr."\n";
print @arr;
print "\n";
##1 2 3 3
##4
##1233
my @arr_1 =
qw{
1
2
3
};
print "@arr_1\n";
print @arr_1;
##1 2 3
##123
cat 3.txt| perl test.pl
print <>;
my $print = print(3+6);print "\n";print "$print\n";
##9
##9
##1
print (3+6)*2;print "\n";
my $print_add = print (3+6)*2;print "\n";print "$print_add\n";
##9
##9
##2
print ((3+6)*2);print "\n";
##18
printf "%g\n",56*2.3;
printf "%3d\n",0.9077777;
printf "%3f\n",0.9077777;
printf "%3.3f\n",0.9077777;
printf "%-5s\n",'app';
printf "%5s\n",'app';
#128.8
# 0
#0.907778
#0.908
#app
# app
printf "%3d%%\n",3.6;
#3%
my @number = ('a','b','c','d','e');printf "". ("%6s\n" x @number),@number;
# a
# b
# c
# d
# e
#
my @items = qw(a b c);printf "I saw\n". ("%10s\n" x @items),@items;
#I saw
# a
# b
# c
#