<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]-->
<style>
<!--
_filtered {font-family:Tahoma;panose-1:2 11 6 4 3 5 4 4 2 4;}
_filtered {margin:1.0in 1.25in 1.0in 1.25in;}

 /* Font Definitions */
 @font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
span.emailstyle17
        {font-family:Arial;
        color:navy;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:Arial;
        color:navy;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
        {page:Section1;}
 /* List Definitions */
 @list l0
        {mso-list-id:208109095;
        mso-list-type:hybrid;
        mso-list-template-ids:-1457617552 1114792812 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;}
@list l0:level1
        {mso-level-start-at:0;
        mso-level-number-format:bullet;
        mso-level-text:\F0D8;
        mso-level-tab-stop:.5in;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:Wingdings;
        mso-fareast-font-family:"Times New Roman";
        mso-bidi-font-family:Arial;
        color:navy;}
ol
        {margin-bottom:0in;}
ul
        {margin-bottom:0in;}
-->
</style>

</head>

<body lang=EN-US link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Mithum,<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>You say:<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal style='margin-left:.5in;text-indent:-.25in;mso-list:l0 level1 lfo1'><![if !supportLists]><font
size=2 color=navy face=Wingdings><span style='font-size:10.0pt;font-family:
Wingdings;color:navy'><span style='mso-list:Ignore'>&Oslash;<font size=1
face="Times New Roman"><span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></font></span></span></font><![endif]><font size=2 color=navy
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:navy'>. . . </span></font><font
size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>demonstrating
that it is </span></font><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>use warnings</span></font><font
size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'> which would
help more in this scenario rather than use strict.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>No, you haven&#8217;t demonstrated that at
all.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>On the one hand, you are assuming that &#8220;require&#8221;
is just like &#8216;C&#8217; language &#8220;#include&#8221; (a pre-processor
directive,) but on the other hand you have ended the module with &#8220;1;&#8221;
which indicates you know that &#8220;require&#8221; is not just like &#8220;#include&#8221;.&nbsp;
The instruction &#8220;require&#8221; is not a pre-processing directive, but
rather, the required file is compiled and executed at the time of inclusion,
and the whole process retains the integrity of the file as a unit of
scope.&nbsp; So . . .<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>From my e-mail:<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>&gt; Get in the habit of putting the
following at the top of every file:</span></font><o:p></o:p></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>&gt; </span></font><o:p></o:p></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
use strict;</span></font><o:p></o:p></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>If you actually do that, i.e. if you put
it at the head of the file &#8220;newbie.pm&#8221;, you will get this message:<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New";color:navy'>Global symbol
&quot;$c&quot; requires explicit package name at newbie.pm line 5.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New";color:navy'>Compilation
failed in require at a.pl line 7.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>That is a compile time message dealing
with declaration.&nbsp; By contrast, &#8220;use warnings&#8221; is a run time
check and has nothing to do with the declaration, except that it calls
attention to your mistaken belief that you initialized something that you haven&#8217;t.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>By the way, I also put &#8220;use warnings&#8221;
at the top of all my files during development, and usually I leave it
there.&nbsp; For performance reasons some people take it out aftter development
is done if they have a performance critical app &#8211; like I said, it is a
run-time check.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Alexander Danel<o:p></o:p></span></font></p>

<div>

<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>

<hr size=2 width="100%" align=center tabindex=-1>

</span></font></div>

<p class=MsoNormal><b><font size=2 face=Tahoma><span style='font-size:10.0pt;
font-family:Tahoma;font-weight:bold'>From:</span></font></b><font size=2
face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'>
chicago-talk-bounces+danel=speakeasy.net@pm.org
[mailto:chicago-talk-bounces+danel=speakeasy.net@pm.org] <b><span
style='font-weight:bold'>On Behalf Of </span></b>Mithun Bhattacharya<br>
<b><span style='font-weight:bold'>Sent:</span></b> Friday, March 05, 2010 10:33
PM<br>
<b><span style='font-weight:bold'>To:</span></b> Chicago.pm chatter<br>
<b><span style='font-weight:bold'>Subject:</span></b> Re: [Chicago-talk] Global
variable behavior</span></font><o:p></o:p></p>

</div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p>&nbsp;</o:p></span></font></p>

<div>

<div>

<p class=MsoNormal style='margin-bottom:12.0pt'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>Thanks for the input. I guess I took
somethings for granted and didn't read up the relevant sections carefully :)<br>
<br>
I am not nitpicking here but I would like to share a few more things which
became more obvious to me - hopefully it will help others too.<br>
<br>
New code follows<br>
======================================================================<br>
</span></font><font size=2 face="Courier New"><span style='font-size:10.0pt;
font-family:"Courier New"'>$ cat a.pl <br>
use strict;<br>
<br>
push @INC, '.';<br>
<br>
our $c = 15;<br>
<br>
require newbie;<br>
</span></font><font size=2 face=Arial><span style='font-size:10.0pt;font-family:
Arial'>======================================================================</span></font><font
size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'><br>
<br>
$ cat newbie.pm <br>
package newbie;<br>
<br>
print &quot;first attempt: &quot; . $c . &quot;\n&quot;;<br>
print &quot;second attempt: &quot; . $::c . &quot;\n&quot;;<br>
<br>
1;<br>
</span></font><font size=2 face=Arial><span style='font-size:10.0pt;font-family:
Arial'>======================================================================</span></font><font
size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'><br>
<br>
$ perl a.pl <br>
first attempt: <br>
second attempt: 15<br>
</span></font><font size=2 face=Arial><span style='font-size:10.0pt;font-family:
Arial'>======================================================================<br>
</span></font><font size=2 face="Courier New"><span style='font-size:10.0pt;
font-family:"Courier New"'><br>
$ perl -w a.pl <br>
Use of uninitialized value $newbie::c in concatenation (.) or string at
newbie.pm line 3.<br>
first attempt: <br>
second attempt: 15<br>
</span></font><font size=2 face=Arial><span style='font-size:10.0pt;font-family:
Arial'>======================================================================<br>
<br>
</span></font><font size=2 face="Courier New"><span style='font-size:10.0pt;
font-family:"Courier New"'>$ perl -v<br>
This is perl, v5.10.0 built for x86_64-linux-thread-multi<br>
</span></font><font size=2 face=Arial><span style='font-size:10.0pt;font-family:
Arial'>======================================================================<br>
<br>
I am just demonstrating that it is </span></font><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>use warnings</span></font><font
size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'> which would
help more in this scenario rather than use strict.<br>
<br>
Something else which confused me after I started understanding our better was
the following - maybe someone can point out if I have miss-understood anything.<br>
<br>
As per perldoc for our<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&quot;our&quot; associates a simple name with a package variable in the<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; current
package for use within the current scope. When &quot;use<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; strict
'vars'&quot; is in effect, &quot;our&quot; lets you use declared global<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; variables
without qualifying them with package names, within the<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lexical
scope of the &quot;our&quot; declaration. In this way &quot;our&quot;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; differs from
&quot;use vars&quot;, which is package scoped.<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Unlike
&quot;my&quot;, which both allocates storage for a variable and<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; associates a
simple name with that storage for use within the<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; current
scope, &quot;our&quot; associates a simple name with a package<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; variable in
the current package, for use within the current<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; scope. In
other words, &quot;our&quot; has the same scoping rules as &quot;my&quot;,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; but does not
necessarily create a variable.<br>
<br>
The first paragraph seems to imply to me that our is for declaring a global
variable as most C developers tend to think of them. If I understand it
correctly our is always associated with a package - if we call our outside a
defined package as is the case in my sample it goes to the package main.<br>
<br>
The second paragraph doesnt help me understand things any better other than to
say that my and our are similar in scope. I would like to quote from <a
href="http://stackoverflow.com/questions/845060/what-is-the-difference-between-my-and-our-in-perl"
target="_blank">http://stackoverflow.com/questions/845060/what-is-the-difference-between-my-and-our-in-perl</a>
which says<o:p></o:p></span></font></p>

<div style='margin-left:30.0pt'>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Available since Perl 5, my is a way to declare:<o:p></o:p></span></font></p>

<div style='margin-left:30.0pt'>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>&nbsp;&nbsp;&nbsp; * non-package variables, that are<br>
&nbsp;&nbsp;&nbsp; * private,<br>
&nbsp;&nbsp;&nbsp; * new,<br>
&nbsp;&nbsp;&nbsp; * non-global variables,<br>
&nbsp;&nbsp;&nbsp; * separate from any package. So that the variable cannot be
accessed in the form of $package_name::variable.<o:p></o:p></span></font></p>

</div>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><br>
On the other hand, our variables are:<o:p></o:p></span></font></p>

<div style='margin-left:30.0pt'>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>&nbsp;&nbsp;&nbsp; * package variables, and thus
automatically<br>
&nbsp;&nbsp;&nbsp; * global variables,<br>
&nbsp;&nbsp;&nbsp; * definitely not private,<br>
&nbsp;&nbsp;&nbsp; * nor are they necessarily new; and they<br>
&nbsp;&nbsp;&nbsp; * can be accessed outside the package (or lexical scope)
with the qualified namespace, as $package_name::variable.<o:p></o:p></span></font></p>

</div>

</div>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Personally the second explanation is much more easier for me
to comprehend than the perldoc but I suppose someone could elaborate what I
might be missing out on if I follow that explanation.<br>
<br>
In any case thanks for listening to me and hopefully I am not making a fool of
myself here with perl basics.<br>
</span></font><font size=2 face="Courier New"><span style='font-size:10.0pt;
font-family:"Courier New"'><br>
</span></font><font size=2 face=Arial><span style='font-size:10.0pt;font-family:
Arial'><br>
<br>
- Mithun</span></font><font size=2 face="Courier New"><span style='font-size:
10.0pt;font-family:"Courier New"'><o:p></o:p></span></font></p>

<div>

<div class=MsoNormal align=center style='text-align:center'><font size=2
face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'>

<hr size=1 width="100%" align=center>

</span></font></div>

<p class=MsoNormal><b><font size=2 face=Tahoma><span style='font-size:10.0pt;
font-family:Tahoma;font-weight:bold'>From:</span></font></b><font size=2
face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'> Alexander Danel
&lt;danel@speakeasy.net&gt;<br>
<b><span style='font-weight:bold'>To:</span></b> Chicago.pm chatter
&lt;chicago-talk@pm.org&gt;<br>
<b><span style='font-weight:bold'>Sent:</span></b> Wed, March 3, 2010 9:00:08
PM<br>
<b><span style='font-weight:bold'>Subject:</span></b> Re: [Chicago-talk] Global
variable behavior<br>
</span></font><br>
<br>
<o:p></o:p></p>

<meta http-equiv=x-dns-prefetch-control content=off>

<div>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Get in the habit of putting the following
at the top of every file:</span></font><o:p></o:p></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>&nbsp;</span></font><o:p></o:p></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
use strict;</span></font><o:p></o:p></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>&nbsp;</span></font><o:p></o:p></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Try it.&nbsp; It will inform you that you
are implicitly doing just what you claim you are not doing: you have declared
(or, as you put it &#8220;redeclared&#8221;) the variable.&nbsp; &#8220;Use
strict&#8221; will protest because implicit declarations are often an accident;
which is clearly appropriate for your case.</span></font><o:p></o:p></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>&nbsp;</span></font><o:p></o:p></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>By the way, I take exception to your
statement &nbsp;&#8220;. . . should make it global across all name
spaces.&#8221;&nbsp; No such concept exists in Perl.&nbsp; You declared the
variable to be in the &#8220;main&#8221; namespace; which you seemingly
understood when you used &#8220;$::c&#8221;, the naked double-colon being an
alias for &#8220;main::&#8221;.&nbsp; &nbsp;The package &#8220;main&#8221; is
in force until you declare otherwise.</span></font><o:p></o:p></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>&nbsp;</span></font><o:p></o:p></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Alexander Danel</span></font><o:p></o:p></p>

<div>

<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>

<hr size=2 width="100%" align=center tabindex=-1>

</span></font></div>

<p class=MsoNormal><b><font size=2 face=Tahoma><span style='font-size:10.0pt;
font-family:Tahoma;font-weight:bold'>From:</span></font></b><font size=2
face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'>
chicago-talk-bounces+danel=speakeasy.net@pm.org [mailto:chicago-talk-bounces+danel=speakeasy.net@pm.org]
<b><span style='font-weight:bold'>On Behalf Of </span></b>Mithun Bhattacharya<br>
<b><span style='font-weight:bold'>Sent:</span></b> Wednesday, March 03, 2010
8:20 PM<br>
<b><span style='font-weight:bold'>To:</span></b> chicago-talk@pm.org<br>
<b><span style='font-weight:bold'>Subject:</span></b> [Chicago-talk] Global
variable behavior</span></font><o:p></o:p></p>

</div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>&nbsp;<o:p></o:p></span></font></p>

<div>

<div>

<p class=MsoNormal><font size=3 face=Arial><span style='font-size:12.0pt;
font-family:Arial'>Hi Everyone,<br>
<br>
A piece of my code is behaving in a way I didn't expect and I was hoping
someone could enlighten me as to why..<br>
</span></font><br>
-------------------------------------<br>
<font size=2><span style='font-size:10.0pt'>$ cat <a href="http://a.pl"
target="_blank">a.pl</a> <br>
push @INC, '.';<br>
<br>
our $c = 15;<br>
<br>
require newbie;<br>
</span></font>-------------------------------------<br>
<font size=2><span style='font-size:10.0pt'>$ cat <a href="http://newbie.pm"
target="_blank">newbie.pm</a> <br>
package newbie;<br>
<br>
print &quot;first attempt: &quot; . $c . &quot;\n&quot;;<br>
print &quot;second attempt: &quot; . $::c . &quot;\n&quot;;<br>
<br>
1;<br>
</span></font>-------------------------------------<br>
<font size=2><span style='font-size:10.0pt'>$ perl a.pl <br>
first attempt: <br>
second attempt: 15</span></font><br>
-------------------------------------<br>
<font face=Arial><span style='font-family:Arial'><br>
The way I see it the </span></font><font face="Courier New"><span
style='font-family:"Courier New"'>our</span></font><font face=Arial><span
style='font-family:Arial'> in </span></font><font face="Courier New"><span
style='font-family:"Courier New"'>a.pl</span></font><font face=Arial><span
style='font-family:Arial'> should make it global across all namespaces. The
second attempt does seem to say that did take place. What I am not sure is why
the </span></font><font face="Courier New"><span style='font-family:"Courier New"'>$c</span></font><font
face=Arial><span style='font-family:Arial'> variable has become local in scope
even though I haven't re-declared or redefined it in any way inside </span></font><font
face="Courier New"><span style='font-family:"Courier New"'>newbie.pm</span></font><font
face=Arial><span style='font-family:Arial'>.<br>
<br>
<br>
<br>
<br>
- Mithun</span></font><o:p></o:p></p>

</div>

</div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>&nbsp;<o:p></o:p></span></font></p>

</div>

</div>

</div>

</div>

<meta http-equiv=x-dns-prefetch-control content=on>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p>&nbsp;</o:p></span></font></p>

</div>

</body>

</html>