in reply to "du" to hash

Sorry for asking a really stupid question, but what does this line do? Yes, it's a regexp, but I can't figure out what it does....
s:/:'}{dirs}{':g;
Another question: will this work for sub-sub-dirs?

Replies are listed 'Best First'.
RE: RE: 'du' to hash
by davorg (Chancellor) on Jul 04, 2000 at 12:02 UTC

    It's a substitution, but it looks a bit strange because it's using ':' as the separator instead of the more usual '/'. This is because '/' is the character that is being replaced, so using a different separator avoids having to escape it.

    In summary, the line looks for all occurances of '/' in $_ and replaces them with '}{dirs}{'.

    --
    <http://www.dave.org.uk>

    European Perl Conference - Sept 22/24 2000
    <http://www.yapc.org/Europe/>