<?xml version="1.0" encoding="windows-1252"?>
<node id="276138" title="calling a sub using its name assigned to a variable ?" created="2003-07-21 00:35:41" updated="2005-08-12 22:25:11">
<type id="1857">
categorized question</type>
<author id="11732">
QandAEditors</author>
<data>
<field name="doctext">
Quickly, I'm hoping to be able to do the following;  depending upon data stored in a file, I'm looking to call a subroutine if the value of a variable of the same name = 1.
&lt;P&gt;
Is this possible? Is there an easier/more efficient way?
&lt;P&gt;
A slightly longer version:&lt;BR&gt;
data file contains the following:
&lt;P&gt;
&lt;B&gt;main_menu:1:1&lt;/B&gt;
'main_menu' is the name of the subroutine
1:1 refers to screen position(0=left 1=right) and hide/display.
&lt;P&gt;
This data is read by sub build_menus.  Simply using 'if' statements, a series of menu 'blocks' are built up to be displayed on screen.
&lt;P&gt;
I had been using static files with straight HTML, but nor wequire that the links which are built dynamically contain other veriables appended to the URL (eg: $language, $menu_option, etc...) and am thinking of using a sub routine to build the URLs - rather than using a substitution script to parse the URL after it's been built.
&lt;P&gt;
Hope this helps so that someone can help me.
&lt;P&gt;
Kind regards from Andorra&lt;BR&gt;
Richard.</field>
<field name="parent_node">
1833</field>
</data>
</node>
