On 11/09/2006 06:56 AM, Sara wrote:
use strict;
use warnings;
use CGI;

my $q = new CGI;

my $do = $q->param('do') || 'main'';


my $do = $q->param('do') || main();

if ($do) {
&$do;
}

sub main {
blah blah
}
=========================================
Trying to call the subroutine main from variable $do but I am gettin' error:
Can't use string ("main") as a subroutine ref while "strict refs.
But somehow I don't want to remove the 'use Strict;'

Any way out?
[...]

Yes.
Start->Run->"perldoc perlsyn"
Start->Run->"perldoc perlsub"




--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to