in reply to Re: finding the last occurence of substring in string
in thread finding the last occurence of substring in string

Thanks, the match operator gets me what I was looking for. But your post brings up another question. What is the meaning of $-[0] ?

Replies are listed 'Best First'.
Re^3: finding the last occurence of substring in string
by BrowserUk (Patriarch) on Jul 26, 2012 at 16:40 UTC
    What is the meaning of $-[0] ?

    See the definition of @LAST_MATCH_START in perlvar.

    $-[0] is the value of the first element of @-. Which, after a successful match, contains the position in the string at which the capturing parens matched.


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.

    The start of some sanity?