in reply to Re^4: user input behavior from within a subroutine
in thread user input behavior from within a subroutine
Very simply, because you need my in your declaration:
use strict; use warnings; my @existingattributes = ();
Then you will no longer get the error.
That's what use strict does; it enforces your declaration of variables with my or our. Using my lets you use it like a global variable (except that it's really a lexical variable), and it's visible only within the lexical scope in which it's declared. If that's at the top of the program file, then the entire program can use it.
However, it you need to share variables between files, you may need to use our instead.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: user input behavior from within a subroutine
by bw (Novice) on Aug 03, 2006 at 16:50 UTC |