i am generating all this web pages using Perl so can't I put menu bar code in separate file, and call it whenever required.
Sure you can :) you can do the same with frobnits.cgi/pagename ... Path::Dispatcher, CGI::Application::Dispatch
example :) run it (maybe perl moannoy.pl daemon -l http://localhost:80/ ), click the links in your browser ....
#!/usr/bin/perl -- use Mojolicious::Lite; get '/' => { template => 'index', title => time };;; app->start; __DATA__ @@ index.html.ep <html> <head> <title><%= title =%></title> </head> <body> <h1><%= title =%></h1> <button onclick="annoying()"> hi </button> <a href="/annoying.js"> /annoying.js </a> %= javascript '/annoying.js' </body> </html> @@ annoying.js function annoying() { alert('hi'); }
or should i write a simple module
You should write that regardless -- doesn't have to be a real module, but each page should be a function DebugCGI
In reply to Re: calling menu bar creating code from another cgi/pl code (mojo)
by Anonymous Monk
in thread calling menu bar creating code from another cgi/pl code
by msinfo
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |