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
In reply to Symbolic reference to a subroutine by UncleRon
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |