good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Greetings Monks! I've got a weird problem. I have a script that is losing two args from ARGV before the script finished compiling. My best guess is that one of my own modules is shifting ARGV in a BEGIN block, but I cannot find it. By putting lots of BEGIN { print join(', ',@ARGV)."\n" } blocks in there and in modules it loads I've narrowed it down somewhat. The heavy lifting for this script is in a module I'm writing. Before I use my module, ARGV is fine. After I use it, ARGV is two items shorter. I put more of my ARGV printers in my module and ARGV is fine at the top of the file all the way to the bottom. So, it looks like something is happening after the compiler finishes reading my module and before it gets back to reading the script that usees the module. Does anyone know what that might be? Because I'm pretty sure that made no sense, I'll try to illustrate with an example: Module.pm
script.pl
Run it...
Note this is not what you see if you run my example code. This is what you get if you run my actual code. My actual code is too huge an embarrasing to post. Woah!I just ran my example code and the results look like:
Which means my understanding of how this stuff is ordered is truly whacked... A BEGIN block is supposed to execute as soon as the compiler finishes reading it, right? How does the order from my example script come about then? Hopefully this post includes enough rambling to alert the many of you who are smarter than me to a plausable error. I'm going to stop typing now. Thanks! --Pileofrogs P.S. I am not crazy In reply to debugging during compile by pileofrogs
|
|