in reply to Converting decimal value to hex

Thank you, the $name =~ s/\s+$//; did remove the extra characters, I would have liked to know exactly what they were, but that's due more to curiosity then the problem I had.

Anyway, Thank you both for your help.

Replies are listed 'Best First'.
Re^2: Converting decimal value to hex
by psini (Deacon) on May 16, 2008 at 17:50 UTC

    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.