I found this piece of code in perl
system("zip $ZIP_DEBUG -r -9 itvlib.zip $include $exclude");
However I don’t understand how it is working. I mean system() is used to fire ‘system’ commands right ? So is this ‘zip’ command used here a ‘system’ command ?
But I tried firing just the following on the command prompt;
zip $ZIP_DEBUG -r -9 itvlib.zip arg1 arg2
It didn’t work !
it gave the following error:
'zip' is not recognized as an internal or external command,
operable program or batch file.
Well this shouldn’t have happened, since the command seems to use ‘zip’ as a system command. So this makes the command ‘zip’ mysterious
Can you please help me to understand this command with all its parameters?
is running a program named
zip(probablyzip.exe) somewhere on the path.$ZIP_DEBUG,$include, and$excludeare Perl variables that are interpolated into the command line before the command is run.If the
systemcall works in the Perl script, butzip -?gives the'zip' is not recognized as an internal or external command, operable program or batch fileerror, then the PATH of the Perl script must be different than the PATH in your command prompt. Or, there might be azipcommand in the current directory when Perl executes thesystemcommand. (In Windows, the current directory is an implicit member of your PATH.)To see what the PATH is for the Perl script, you can add a
print "$ENV{PATH}\n";before the system command. To see what the PATH is in your command prompt, typePATH.