On Tue, 23 Aug 2005 07:25:05 -0700, Todd Lewis wrote:

> I'm trying to retrieve the last word from an HTML table cell stored in 
> an array value.
> All of the words are space delimited.
> I've tried using split /\s/, $$row[1] but this doesn't always return the 
> last
> word for me since there could be 2,3, or 4 words.

List slice:

  $last_word = (split /\s/, $row->[1]//)[-1];

-- 
Peter Scott
http://www.perlmedic.com/
http://www.perldebugged.com/


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to