in reply to Re: i thought i knew 'our'...
in thread i thought i knew 'our'...

'our' and 'my' are two very different beasts. You can not substitute 'our' with 'my' or vice versa, take this as an example:
use strict; { our $y; $y = 17; print "Inner: $y\n"; } our $y; print "Outer: $y\n";
That will print:
Inner: 17
Outer: 17
Now, if you substituted our with my (s/our/my/g) then it would print:
Inner: 17
Outer:
...and it would complain about use of uninitialized variable :-)

Autark.

Replies are listed 'Best First'.
RE: RE: Re: i thought i knew 'our'...
by monk (Scribe) on Jul 24, 2000 at 21:17 UTC
    you are right, what i meant was that our could be use to declare variables in the begining
    of a program like:
    #!/usr/bin/perl -w use strict; our($foo,@bar,%args); <- this was what i meant.
    Not to s/my/our/; as you pointed out. Sorry didn't explain myself quite right.
    monk