#!/usr/bin/perl use CGI; use strict; my $query = new CGI; print $query->header; my %func_map = ( home=>\&home, news=>\&news, ); my $default = "home"; my $location = $query->param("place") || $default; $location = $default unless exists $func_map{$location}; $func_map{$location}->(); sub home{ print "this is home"; } sub news{ print "this is news"; }
In reply to Re: efficiency
by runrig
in thread efficientcy
by john1987
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |