in reply to Re: A Better Way to Find the Position of the Last Non-Whitespace Character in the Last Element of an Array.
in thread A Better Way to Find the Position of the Last Non-Whitespace Character in the Last Element of an Array.

I originally tried rindex, but the last non whitespace character won't always be a colon unfortunately.
  • Comment on Re^2: A Better Way to Find the Position of the Last Non-Whitespace Character in the Last Element of an Array.
  • Download Code

Replies are listed 'Best First'.
Re^3: A Better Way to Find the Position of the Last Non-Whitespace Character in the Last Element of an Array.
by Fletch (Bishop) on Apr 22, 2009 at 21:24 UTC

    Aaah, I missed that qualification (got stuck on the specific example). $idx = $+[1] if $MessageLines[-1]=~/(\S)\s*$/ then.

    The cake is a lie.
    The cake is a lie.
    The cake is a lie.