jira0004 has asked for the wisdom of the Perl Monks concerning the following question:
Hi,
I do a substantial amount of development work in Perl.
Typically, I use the Perl strict module to force the declaration of variables via the use of the Perl keword my . Presently, I am involved in an integration project at work. We are using Perl to integrate several technologies. I have successfully encouraged my development team to use the Perl strict module to force declaration of variables to avoid the various pitfalls associated with the ability to use variables without declaring them, such as misspelling a variable name and having Perl treat it as two different variables instead of two instances of the same variable. One of the members of my team is using the Perl keyword our to declare variables within one of the Perl scripts we are developing. I have never seen the Perl keyword our and so didn't know it could be used to declare variables within a script.
What is the Perl keyword our? What is it used for? How is declaring a variable using the keyword our different from declaring a variable using my?
Thanks for any helpful replies and input
Sincerely,
Peter Jirak
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Perl keywords for declaring variables: my, our and local???
by cchampion (Curate) on Mar 22, 2003 at 18:36 UTC | |
by Anonymous Monk on Nov 03, 2010 at 08:00 UTC | |
by Anonymous Monk on Jan 03, 2013 at 15:08 UTC | |
|
Re: Perl keywords for declaring variables: my, our and local???
by krusty (Hermit) on Mar 22, 2003 at 19:24 UTC | |
by demerphq (Chancellor) on Mar 23, 2003 at 10:07 UTC | |
|
•Re: Perl keywords for declaring variables: my, our and local???
by merlyn (Sage) on Mar 22, 2003 at 19:11 UTC | |
by jira0004 (Monk) on Mar 22, 2003 at 19:46 UTC | |
by larsen (Parson) on Mar 22, 2003 at 19:55 UTC |