in reply to Replace all occurrences but the last

untested:
s/\.(?=.*?\.)/_/g;

-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.

Replies are listed 'Best First'.
Re^2: Replace all occurrences but the last
by kiat (Vicar) on Aug 22, 2004 at 15:27 UTC
    Thanks, merlyn!

    I was trying with the positive lookahead thing but I just didn't get it.