-$ifn = "$prefix/wpxloc.raw" if !$ifn;
-open (IN, $ifn) or die "can't open $ifn ($!)";
+$ifn = $system ? "$main::data/wpxloc.raw" : "$prefix/wpxloc.raw";
+unless (open (IN, $ifn)) {
+ $ifn = "$main::data/wpxloc.raw";
+ open(IN, $ifn) or die "can't open $ifn ($!)";
+}