Recommanded Free YOUTUBE Lecture: <% selectedImage[1] %>

Perl은 trim 내장함수를 지원하지 않는다. 이 함수는 String의 처음과 끝에 있는 white space를 제거한다.
sub trim($)
{
	my $string = shift;
	$string =~ s/^\s+//;
	$string =~ s/\s+$//;
	return $string;
}

#!/usr/bin/perl

$string = "\tHello World\n";
print trim($string),"\n";