Sed - An Introduction and Tutorial
grymoire.com
grymoire.com
ls -R | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/ /' -e 's/-/|/'
courtesy of this site: http://www.centerkey.com/tree/
As a bonus, most (all?) of the sed commands are also usable in vi's ex mode (the : prompt).
Perl has a lot of syntactic sugar for quick-and-dirty regex stuff, derived directly from sed and awk, while Python instead has sugar for list slicing, dictionaries, etc., but uses function syntax (e.g., re.search(pattern, string)) for regexes. I would rather have great syntax for lists and dicts, personally.