url {
# some Perl code to be invoked on receiving the URL
}
####
/edit?node=(\w+);... {
print "You're trying to edit '$node'";
};
/create?name=(\w+);... {
print "You're trying to create '$name' but gave no code to fill it";
};
/create?name=(\w+);code=(.*) {
print "Created as sub $name { $code }";
};
/(.*) {
print "Don't know how to handle " . $q->query_path;
};
####
# /edit?node=(\w+);... {
# print "You're trying to edit '$node'";
# };
sub edit_node {
my ($q) = @_;
return
if ($q->param('node') !~ /^(\w+)$/;
my $node = $1;
print "You're trying to edit '$node'";
};