Help for this page

Select Code to Download


  1. or download this
    $path='./anything/../.../something'; #example
    $path=~s!/+!/!g; #replace //// by single /
    ...
    $path=~s!^([^/]{3,}|[^/.][^/]*|\.[^/.])/\.\./!!;  #remove starting som
    +ething/../
    $path='.' if $path eq ''; #point current path if finally it is empty
    #at this place $path is normalized