Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^7: Perl command line switches

by AnomalousMonk (Archbishop)
on Mar 27, 2020 at 20:16 UTC ( [id://11114740]=note: print w/replies, xml ) Need Help??


in reply to Re^6: Perl command line switches
in thread Perl command line switches

... i tried running the script as follow: perl create_s_t_xml.pl -v 0.1 and it ge , ...

I don't understand this statement. Was there absolutely no output at all? In most cases, output statements like

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:  <%-{-{-{-<

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11114740]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (7)
As of 2024-04-25 15:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found