abulafia has asked for the wisdom of the Perl Monks concerning the following question:
So, $user and $html are both apparently out of scope:sub a_moduser { our $user = shift; our $html; [...] $html = '<form action="' . $$config{selfpath} . 'method="post +">'; find(\&wanted, $$config{base_dir}); [...] } sub wanted { [...] $html .= '<td><input type="radio" name="base_dir" value="' . $_ . +'"></td>'; [...] }
I tried sticking the variables and the find call in a BEGIN block, which shut the error messages up, but caused all sorts of grief with calling other subroutines. I'm a little lost in terms of what to do from here. Any kindly monks with suggestions? Thanks much.Variable "$html" is not imported at fileman.cgi line 707. Variable "$html" is not imported at fileman.cgi line 708. Global symbol "$html" requires explicit package name at fileman.cgi li +ne 707. Global symbol "$html" requires explicit package name at fileman.cgi li +ne 708.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Scoping and File::Find
by borisz (Canon) on Jul 19, 2004 at 21:37 UTC | |
by abulafia (Sexton) on Jul 19, 2004 at 22:00 UTC |