I am trying to replace the whitespace in the following string with nulls (ignore the quotes) "BPLIF(many spaces)" Here is the code I am using
$_ =~ s/^\s+//g; $y = length $_; print "$_ $y\n";
Where I would like "BPLIF" back in $_, I keep getting "BPLIF(many spaces)". I am using the length and print statements to test the results. From what I have read "^" means start at the beginning, \s means whitespace, and + means more than one white space. What am doing wrong?
In reply to Replacing whitespace with null by treebeard
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |