#!/usr/bin/perl

$string1 = "This is test";
$retval  = chop( $string1 );

print " Choped String is : $string1\n";
print " Character removed : $retval\n";

结果:

 Choped String is : This is tes
 Number of characters removed : t