Then the question might or might not have anything to do with the MORELOGS input, depending on how you assign values to $gzipLoc. If that string is not a problem, then the problem is that you are now getting lines of data from the file cited by $arcLogsUsToo -- is this file generated by some other Perl script (or by some other snippet in the current script)?$error = system("$gzipLoc $dupeDir/$logFile");
Given how you are handling the lines from MORELOGS, it's very plausible that you now have lines like:
Note the semi-colon. To work through this, here's the first thing to try:Error message; no such file
The "multi-argument" usage of system() is safer -- the sub-process named by the first variable is exec'ed, and its argument list is given to it as the list of subsequent args in the system call. When you pass system() a single scalar string, and if that string contains shell meta-characters (i.e. job control things like "|", "&", "<", ">" and of course semi-colon), it will launch a sub-shell, and pass the whole string as a command line. So if you have metacharacters in a variable that you believe is just a file name, and you put that into a single-string arg to system(), you're likely to be screwed.# $error = system("$gzipLoc $dupeDir/$logFile"); # NOT THIS WAY $error = system($gzipLoc, "$dupeDir/$logFile"); # THIS WAY (update: +fixed spelling)
In reply to Re: 5.8.3 error not thrown by 5.8.0
by graff
in thread 5.8.3 error not thrown by 5.8.0
by gennari
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |