Simple question. How does chomp change the contents of the string without the need to pass it in by reference?
$/="!"; $chomper = "chomp! chomp! chomp!"; chomp($chomper); print $chomper; #outputs chomp! chomp! chomp
....but notice I didn't need to pass in \$chomper for a reference to the scalar and its value changed anyway. How is this done?
In reply to chomp it chomp it good by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |