UncleRon has asked for the wisdom of the Perl Monks concerning the following question:
In just a little bit I set $updatefile = 'ProcessGuestBook';$localfile = 'customer'; $ulocalfile = ucfirst($localfile); $newdir = "$path/$localfile"; MakeDir(); # # SECOND GET THE FILE LAYOUT AND INITIALIZE FILE MANAGEMENT TOOLS # $getfile = "Read$ulocalfile"; $updatefile = $guestfile = "Write$ulocalfile"; $deletefile = "Delete$ulocalfile"; require "$path/files/$ulocalfile"; require "$path/processes/GuestBook";
The main script calls the subroutine by &$updatefile. So far so good. Now when I get into the ProcessGuestBook subroutine I have a need to change &$updatefile to refer to it's orginal value. I thought I could just reset it by $updatefile = $guestfile and then invoke the subroutine &$updatefile. What I get is an error letting me know that the script can't find the subroutine.
Any way to change the reference on the fly?
UR
janitored by ybiC: Retitle from "anonymous subroutine", minor format tweaks for legibility
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Symbolic reference to a subroutine
by sauoq (Abbot) on Dec 19, 2003 at 21:30 UTC | |
|
Re: Symbolic reference to a subroutine
by Zaxo (Archbishop) on Dec 19, 2003 at 21:56 UTC |