Wasn't sure what to put in the title of the queston. I'm a little confused by the following behavior. I'm trying to strip the HTML tags from a variable and save that value to another variable. I have the following code:
$item->{'notag_title'}=&strip_tags($item->{'title'}); sub strip_tags { $_[0]=~s/<[^>]+>//gs; return $_[0]; }
As expected $item->{'notag_title'} becomes a tag-less version of $item->{'title'}. But $item->{'title'} loses its tags too! I don't understand it at all. Is $_[0] a reference to the original variable, not a variable local to the subroutine?
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |