As I said before, the script works as intended.
If one would write "$zu" in a Template he would get an empty string as I don't want to expose script internals just by error.
# But if I change these lines in sub getValue from
...
# here starts the nightmare
# so the provide hash had no key with such name
} else {
# I FEAR THIS
no strict "refs";
# uhm, but it exists, in our namespace ? in our scope? besides
+?
if (defined $$var){
# if so, then take the value of the skalar
$result = $$var;
} else {
warn "undefined Variable $var requested!";
}
}
...
#to
} else {
$result = '$'.$var;
$result =~ s/(\$\w+)/$1/eeg;
}
I don't get an error
- BUT a warning in my log stating that $var has not been imported
- BUT one would get the current value of $zu
which is exactly what I try to avoid, besides, then he gets an empty string for the skalars defined in the required script.
I wouldn't ask if I had a clue on this ;-)
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.