# 悪い例
(split /\//, $x)[0..(split /\//, $x)-2]