cmora111:
I've looked over your code a bit, and would like to give a better critique of it, but I don't really have the time for that right now. What I had time for, though, was this:
- Change the bit from:
my $type = "";
my $name = "";
my $action = "";
to:
our ($type,$name,$action);and you'll get some values in your output file. The scoping is getting confused a bit, but I don't know why. (There are a few oddities in your program that make it unclear to me at present.)
- You didn't provide the source code to X10::Item, so I had to comment out the references to it in the code you did provide, and that seemed to be enough for some simple debugging.
- In X10::Config::printConfig, your if statement for the ZONE case doesn't set $action so it's using the default value from the HU item, which appears to be undefined for a zone.
- For debugging output formats, I frequently find it useful to add some unique text at the end of each format line for debugging (to ensure that the correct format line is selected and is printing), kind of like this:
format fmtZone =
@<<<< @<<<<<< @<<<<< dbgZONE
$type, $name, $action
.
format fmtGroup =
@<<<< @<<<<<< @<<<<<< dbgGROUP
$type, $name, $action
.
Your program was generating a file of blank lines, so without the debug text on the format lines, I couldn't tell which bits of code were actually executing.
- While I'm personally a fan of the format statements, you'll likely get a few messages suggesting you use printf statements. It's not a bad idea to consider them. Another interesting alternative can be pack. I generally use printf statements because:
- the format is immediately next to the code generating the report, and
- I frequently generate the formats on the fly to accommodate the data widths in the data for which I'm creating my reports.
I really don't expect to have any time for it today, but if the chance arises, I'll look over the code again later and try to offer a few more pointers.
...roboticus
When your only tool is a hammer, all problems look like your thumb.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.