in reply to Re: Converting decimal value to hex
in thread Converting decimal value to hex
If you want to access the removed part of the string, try:
$name =~ s/^(.*?)(\s*)$/$1/;
It is almost the same that you tried but with two little differences: the first quantifier is not greedy (*? instead of *) so it will not eat up the spaces and the second part of the expression now catches all \s characters until the end of line.
Rule One: Do not act incautiously when confronting a little bald wrinkly smiling man.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Converting decimal value to hex
by grizzley (Chaplain) on May 19, 2008 at 09:35 UTC |