It seems $0 behavs differently from system to system. I only get a filename when I use $0 but I can use $^X.