Replace \w (word character) with \S (non-whitespace) in the regular expression and it should work.
my ($variable) = `your command` =~ /(\S+)$/;
In reply to Re^3: Cutting last word from a output line
by kroach
in thread Cutting last word from a output line
by Bharath.M.R
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |