Fix: try to use dirname perl library