filmo has asked for the wisdom of the Perl Monks concerning the following question:
I've set up the following code, but the system call doesn't seem to execute in the right direcotry
I've run this and it sets the $ENV{'PATH'} correctly, (I send a sysem("date") call and that runs fine.) What I don't undertand is why the gzip command isn't executing inside of the correctly set PATH. Currenly, it appears to be executing in the directory I'm calling the script from because if I put a file of the same name in the script's directory, it will get gzipped. (i.e. ../cgi-bin/$file ends up ../cgi-bin/$file.gz)while (args here) { $new_dir = code to figure out correct path... $file = code to determine file to work on... $ENV{'PATH'} .= ":/home/mysite/documents/daily/$new_dir"; system("gzip $file") == 0 or die "can't gzip file"; $ENV{'PATH'} = gets reset to original path here. }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: gziping files on server
by Zaxo (Archbishop) on Jul 17, 2001 at 09:49 UTC | |
|
Re: gziping files on server
by MZSanford (Curate) on Jul 17, 2001 at 13:12 UTC | |
|
Re: gziping files on server
by grinder (Bishop) on Jul 17, 2001 at 14:01 UTC | |
by scain (Curate) on Jul 17, 2001 at 17:54 UTC |