Do you know what the -p switch does in your script?
Do you know what the -v switch does in your script?
The -v switch consumes one more argument from @ARGV and writes into a variable $version. That value is then stripped out from the string contained in the $XLFILE variable.
You don't show us where in your code the $XLFILE variable is populated, but most likely that file is what you want?
Or maybe the output filename is c_vewnts.xml - that is mentioned somewhere later.
My approach would be to talk to the people who wrote that program, or to the people who use that program and ask them about what the program does, and what its input parameters are and where it writes its output.
| [reply] [d/l] [select] |
Hi the output file should be an .XML file which i believe is in the code as "c_vents.xml" I am just ensure of which arguments to parse on the script to generate the .XML file
i tried running the script as follow: perl create_s_t_xml.pl -v 0.1 and it ge , why does it not generate the .XML file ?
| [reply] |
printf(" <Unc>\n <ProcessArea name=\"%s\">\n", $box);
printf(" </ProcessArea>\n </$area>\n");
printf while <COXML> ;
will output by default to STDOUT (which usually is the terminal), but this need not be the case; see select. From the code I've seen, I would expect some output to the terminal, not to a file.
... the output file should be an .XML file which i believe is in the code as "c_vents.xml" ...
The code
my $cvents = "c_vents.xml";
if (-f $cvents)
{
open(COXML, $cvents ) || die("Cannot Open $cvents");
printf while <COXML> ;
}
tries to open the file c_vents.xml for input and then print the contents of the file, probably to STDOUT; see above for the justification for this guess.
In addition to the points made above, I would ask the following questions, some of which have already been asked by others:
-
Is main() ever executed? How do you know?
-
Operation of the script depends on the presence of certain files, e.g., ../vents.v$version.pl and apparently whatever $XLFILE is. Do these files exist in your testing configuration? Is your current working directory correct to access the relative path of at least one of these files?
-
What's going on in functions like print_t_xml_hdr() create_t_recs() print_t_xml_tail() which may be generating some kind of output, but which we are never shown?
-
What are the contents of global variables like $XLFILE @SBoxes %P_UCventList on which the operation of the script (and the generation of output) seems to depend, but which we are never shown?
Normally I would ask to see the entire script, but I'm afraid to do that because what you have shown us so far is such a terrible mess; I really don't want to start a fight with this tar-baby.
Give a man a fish: <%-{-{-{-<
| [reply] [d/l] [select] |
In addition to what Corion said, are you sure your main() is called? And more, does it get past that require "../vents.v$version.pl";? If the main() sub is called then you should be able to see some XML header if all goes well... Best thing to do is to make a copy of that script and at some places add print "here1\n"; etc. to see what is the flow.
| [reply] [d/l] [select] |