perl chomp的例子。
代码:
#!usr/bin/perl
use warnings;
use strict;
my @array = ( "Onen", "Twon", "Three", "Four", "Fiven" );
my $newlines = chomp ( @array );
print "nWe just removed $newlines newlines from that list!n";
print "nThe list is now @array.";