Example: $filename=/usr/local/bin/perl I have to display a tree like this 1. /usr/ 2. /usr/local/ 3. /usr/local/bin/