in reply to Re: Answer: How do I remove whitespace at the beginning or end of my string?
in thread How do I remove whitespace at the beginning or end of my string?

The test is to remove leading and trailing whitespace from a string. The assignment to $_ is an initialization condition of the test: it has to have the string value in it, and then have the whitespace removed.

Update:
Oh, now I understand what you're saying. It just didn't occur to me that it could make a significant difference what kind of variable was being operated on.


The PerlMonk tr/// Advocate
  • Comment on Re: Re: Answer: How do I remove whitespace at the beginning or end of my string?