my ($variable) = `echo $line` =~ /(\w+)$/; #### my $output = `echo $line`; $output =~ s/(\w+)$//; my $last_word = $1;