Thank you mighty perl Monks for your wisdom!
(this is the orginal poster, I'll have to make a user name at some point).
I do appologize for the confusion on debugging, all of your assumptions were correct and and the forloop was masking my outer variable. I was attempting to showcase the problem from a much larger program, after seeing your code snippits, I think I have a better idea of how to showcase things (I will read the linked page too, though I do point out, I knew what I meant, and you knew what I meant too, beginers luck?).
I have read many web pages on perl scoping (global vs lexical) including the documentation on key words 'my' and 'our' packaged within the perl install. I'm afraid I still think of "my $var;" used out side of a function as global to the file which would be its C/C++ equivalent and it appears to be the case in perl (excepting its use in forloops). I tend to think of using "our $var;" as the equivalent of an external command in C/C++, a way to link a file global var across mulitple files. Is this incorrect?
How does one declare a global variable if "use strict;" is in effect? As soon as I declare it via 'my', it is lexical not global.
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.