Help for this page

Select Code to Download


  1. or download this
        $directory =~ s<^/*></>
                   .   </*$></>;
    
  2. or download this
        $directory =~ 
            s< ^  /?            # match leading '/' if present
    ...
                  /? $          # match trailing '/'
             >
             </$1/>x;    # now surround the middle with '/'