in reply to Re:Choose your own Adventure - for Perl & Windows
in thread Choose your own Adventure - for Perl & Windows

It looks like you want to propose a better way... I welcome your tutorial.

Well. I present a gentle way to install Strawberry Perl executable, that sets the path for you, and registers .pl extensions to perl.exe... and then you double click on it and poof it works. Quick results. One file. All in there (well, I removed cookies, threading, and ssl). Sure, takes a while to understand, but everything is exposed, instead of hidden in perl-modules which also take time to grasp. I would double the installation time with Dancer or Mojo (due to the large amount of tests during the cpan install).

  • Comment on Re^2: Choose your own Adventure - for Perl & Windows

Replies are listed 'Best First'.
Re^3: Choose your own Adventure - for Perl & Windows
by Anonymous Monk on Apr 19, 2017 at 21:54 UTC
    "I welcome your tutorial."
    use strict; use warnings; use Mojolicious::Lite; my %pages = ( '/' => { title => 'Begin', blurb => 'This is where you begin.', choices => [ { text => 'Choice 1', link => '/foo' }, { text => 'Choice 2', link => '/bar' }, ], }, 'foo' => { title => 'Foo', blurb => 'This is what happens when you Foo.', choices => [ { text => 'End', link => '/end' }, ], }, 'bar' => { title => 'Foo', blurb => 'This is what happens when you Bar.', choices => [ { text => 'Restart', link => '/' }, { text => 'End', link => '/end' }, ], }, 'end' => { title => 'End', blurb => 'This is the end.', choices => [], }, ); get '/' => { template => 'index', %{ $pages{'/'} } }; get '/:key' => sub { my $c = shift; my $key = $c->param('key'); return $c->reply->not_found unless $pages{$key}; $c->render( template => 'index', %{ $pages{$key} } ); }; app->start; __DATA__ @@ index.html.ep <html> <head> <!-- links to bootstrap here --> <title><%= $title %></title> </head> <body> <div class="container"> <h1><%= $blurb %></h1> % for my $choice (@$choices) { <a href="<%= $choice->{link} %>" class="btn btn-primary" role="but +ton"><%= $choice->{text} %></a> % } </div> </body> </html>
    All that extra code you have is unnecessary.
Re^3: Choose your own Adventure - for Perl & Windows
by Anonymous Monk on Apr 12, 2017 at 21:54 UTC
    "I would double the installation time with Dancer or Mojo (due to the large amount of tests during the cpan install)."

    Don't run the tests then.

    "but everything is exposed, instead of hidden in perl-modules which also take time to grasp"

    That is a poor way of looking at things. Rather than expose your own solution which simply reinvents a wheel that was already produced, tested AND deployed ... you get to use a solution that maintained by someone else. Nothing is hidden.

    "Sure, takes a while to understand, "

    It takes LONGER to understand your code and more importantly, it will take longer to correct, improve and maintain your code base. Really, you should be ashamed for posting that crap here and you should be publicly berated for your attitude.