Cheap web site hosting service by Active-Venture.com
  

 Back to Index

chop

chop VARIABLE
 
chop( LIST )
 
chop

Chops off the last character of a string and returns the character chopped. It is much more efficient than s/.$//s because it neither scans nor copies the string. If VARIABLE is omitted, chops $_. If VARIABLE is a hash, it chops the hash's values, but not its keys.

You can actually chop anything that's an lvalue, including an assignment.

If you chop a list, each element is chopped. Only the value of the last chop is returned.

Note that chop returns the last character. To return all but the last character, use substr($string, 0, -1).

See also /chomp.

 

  

 

Cheap domain name: Register domain name -
Domain name services from just
$8.95/year only
 

Register domain name search -
Buy domain name registration and cheap domain transfer at low, affordable price.

© 2002-2004 Active-Venture.com Web Site Hosting Service

 

[ A printer consists of three main parts: the case, the jammed paper tray and the blinking red light.   ]

 

 
 
 

Disclaimer: This documentation is provided only for the benefits of our web hosting customers.
For authoritative source of the documentation, please refer to http://www.perldoc.com