I explicitly said that the changes were to aid in
debugging, to provide more information.
I'm trying to help you fix a problem without knowing what
kind of inputs you're feeding this program, etc.
And all at a *very* reasonable price, I might add =)
Here's some advice: go ahead and load the @ARGV variables into ones with names that reflect their purposes. That's just for the future.
For now, let's look at the documentation for mkpath:
`mkpath' takes three arguments:
o the name of the path to create, or a reference to a
list of paths to create,
What you're now passing it is a reference to a list of directories, one of them being $ARGV[0] and the other being $SingleUserDirectory. You're telling it to create these two paths. (From the looks of your code, you more or less cut-and-pasted the code in the manpage and changed the variable names)
What I assume you want to do is to create a copy of the directory tree at $ARGV[0] underneath the user's directory. That's one path, which you get by tacking on the former to the latter (assuming the latter is fully qualified or underneath the current working directory). Why is your call failing? Well, assuming the names are correct, those directories already exist.
so,
mkpath("${SingleUserDirectory}$ARGV[0]", 1, 0755)
or die "Couldn't create ${SingleUserDirectory}$ARGV[0]: $!\n";
would seem to be what you want.
Philosophy can be made out of anything. Or less -- Jerry A. Fodor |