You can read more about "our" at our variables.
If you "clobber" an "our" variable, you get a warnings, but it is still there and accessible with the full name. See demo code below. To declare a variable before use, "my" is almost always the "right answer", even with getopts.
A "my" variable is completely "private" and cannot be accessed except in the scope and package in which it is declared. An "our" variable gets put into the package's symbol table and can be accessed by a different compilation unit, if the full name is used or if it is "exported" and "imported" by another package.
#!usr/bin/perl use warnings; use strict; our $x = 99; my $x = 4; print "lexical my version of x=$x\n"; print "package version of x=$main::x"; __END__ "my" variable $x masks earlier declaration in same scope at C:\testing +\ourdemo.pl line 6. lexical my version of x=4 package version of x=99
In reply to Re^3: A non-blocking socket operation could not be completed ?
by Marshall
in thread A non-blocking socket operation could not be completed ?
by slugger415
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |