--- [EMAIL PROTECTED] wrote: > Ok, I got sorta a hard question<I think> that involves > calling randomly changing subroutines.
Hmm... instantanously the security alarm bell sounds. > What I'm trying to do is this. 5 libaries are required > into my CGI(PERL) program. Each of them has their own > set of subroutines. And they are? > Now when someone accesses my site they also send a page > referance eg "main.cgi?page=home" What I'm trying to > get my code to do is take 'home' and then start runing > subroutines based on a file entry that can be edited > from my admin section of this site. So basically the > file looks like this. > > home|&htmlBody,&Header,&homebody,&footer Yuk. I don't really like this approach, why not consider HTML::Template which you can get from www.cpan.org - this is a HTML templating system that can do most of this work... in a way that someone coming along later can maintain easily. Alternatively, use server side includes (SSI) which basically does the same thing. I can't understand the advantage of structuring things like this. > So it should get the list of subroutined to call but I can > not figure out how to call them since they are strings and > not hard coded into the code. Warning! That file would be security critical, and should be treated with great care. Anyone in control of it could call arbitary perl functions and subroutines - albeit without any arguments. You need: { no strict; &{$var}; } Did I mention all CGI scripts should start rather like: #!/usr/bin/perl -wT # warnings_/ \_Taint mode checking (EXTREMELY IMPORTANT WITH CGI) use 5.005; # Minimum version use strict; # Strictures - VERY important Take care, Jonathan Paton ===== s''! v+v+v+v+ J r e P h+h+h+h+ !s`\x21`~`g,s`^ . | ~.*``mg,$v=q. P ! v-v-v-v- u l r e r h-h-h- !12.,@.=m`.`g;do{$.=$2.$1,$.=~s`h E ! v+v+v+ s k e h+h+ !`2`x,$.=~s`v`31`,print$.[$v+=$.] R ! v-v- t H a c h h- !}while/([hv])([+-])/g;print"\xA" L ! A n o t !';$..=$1while/([^!]*)$/mg;eval$. __________________________________________________ Do You Yahoo!? Everything you'll ever need on one web page from News and Sport to Email and Music Charts http://uk.my.yahoo.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]