in reply to newbie quesiton:how to open file in crob job?
If you want a cross platform way of dealing with paths, check out File::Spec. For instance, if you wanted to change the specific directory ./foobar to an absolute, non platform specific (*nix) directory you could use the following:
use strict; use warnings; use File::Spec; # print a path that is system independent print "The dir is ", File::Spec->rel2abs("./foobar"), "\n";
You can do all sorts of cool things with File::Spec involving directories, allowing you to use Unix style names on Windoze and Visa versa. The only caveat is to use $ENV{HOME} for the home directory -- ~/ is only the home directory for some shells, so it is not properly translated.
|
|---|