Re: Last word

2005-08-23 Thread Todd Lewis
Thanks, for all the replys. Didn't know that you could simply reference the last element of an array by using [-1]. This seemed like it could be a one line task maybe two, just don't have command of the language. Peter Scott wrote: On Tue, 23 Aug 2005 06:17:11 -0700, I wrote: $last_wor

Re: Last word

2005-08-23 Thread Peter Scott
On Tue, 23 Aug 2005 06:17:11 -0700, I wrote: > $last_word = (split /\s/, $row->[1]//)[-1]; I seem beset by typos today. Don't know where that // came from. Should be: $last_word = (split /\s/, $row->[1])[-1]; -- Peter Scott http://www.perlmedic.com/ http://www.perldebugged.com/ -- To u

Re: Last word

2005-08-23 Thread Peter Scott
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

2005-08-23 Thread Todd Lewis
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. Could someone point