In this code, "use CGI" is not used. So how will the progrma understand the environment variables ?Offhand, I don't see any environment variables being used. If they were, it might be done through the %ENV special variable, or through some mechanism established via the TeamSite::Config or OLG::tpl_utils modules.
variable is defined as ($iwcfg) , why do we need bracket around variable name, what does it do ?This is not a variable definition, but an assignment to the variable $iwcfg which has apparently been defined in some other part of the code (assuming that strictures have been enabled, as they always should be). If strictures have not been enabled and $iwcfg has not been elsewhere defined, the package variable $iwcfg would autovivify at this point. In any event, the parentheses do nothing in this statement.
There are my variables declred with brackets as well. So what does it do when there are brackets around variable name ?The only my (or lexical) variables I see that are defined within brackets are in statements like
Whats the point in declaring my variables at the top level in program. Since my variables are used for localalization of the sciope, why is it at the top ?Except for $iwmount, the lexical variables seem to have been defined fairly close to the point at which they are used. This is good practice. The lexicals $iwhome and $iwmount may have been defined together at the top of the code fragment to emphasize their common origin from TeamSite::Config module functions.
Whats the point in declaring "$dcrpath" and "my $dcrpath" at the same level ? Are they different from each other ?In the statements
BTW, $dcrpath also apprears in the useless (in the context of this code fragment) statement
$dcrpath =~ m/\/([^\/]+)\/data/;
in which a match is done and a sub-string is (potentially) captured, but no result of the match is ever used.
In reply to Re: Perl program questions
by AnomalousMonk
in thread Perl program questions
by manishrathi
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |