在Perl中,可以使用print语句来输出多行内容。有两种方法可以实现这个目的:
print "This is line 1\n";
print "This is line 2\n";
print "This is line 3\n";
print <<END;
This is line 1
This is line 2
This is line 3
END
在上面的例子中,END表示结束here文档的标记,可以使用任何你想要的标识符。在这个标记之间的内容将被输出为多行字符串。
亿速云「云服务器」,即开即用、新一代英特尔至强铂金CPU、三副本存储NVMe SSD云盘,价格低至29元/月。点击查看>>
推荐阅读:python怎么用print输出多行