wordcounter - an application built using Navegante
Build the application:
$ navegante examples/wordcounter
Use the newly created file wordcounter as a CGI.
This application behaves as a CGI and it counts the words being in the content being browsed. On every request we are using the live feedback option of our application banner to print the number of browsed words. Also, we are keeping track of the total of words being counted, we print this information when the user quits the application. The specific DSL section is:
cginame(./wordcounter) formtitle(Word Counting Tool) proc(wcFunction) desc(wcDesc) init(wcInit) livefeedback(wcLive) quit(wcQuit)
$current
This variable is used to keep count of words in every request.
wcDesc
This function prints the description of the application. This is defined in the DSL by the desc statement.
desc
wcFunction
This is the function that actually counts the number of words. This is defined in the DSL by the proc statement.
proc
XXX - _loadit
wcLive
This is the function that prints the HTML that feeds the banner section for reporting information. This is defined in the DSL by the livefeedback statement.
livefeedback
wcInit
This function runs on the beginig of every request and it's used here to reset the word counter. This is defined in the DSL by the init statement.
init
wcQuit
The function that is called when the user follows the link to leave the application. This is defined in the DSL by the quit statement.
quit
Nuno Carvalho, smash@cpan.org
TODO
To install App::Navegante, copy and paste the appropriate command in to your terminal.
cpanm
cpanm App::Navegante
CPAN shell
perl -MCPAN -e shell install App::Navegante
For more information on module installation, please visit the detailed CPAN module installation guide.