#!/usr/bin/perl -wl use strict; my $str = "this is a string"; print +(split /\s/,$str)[-1]; __END__ outputs: string