Perl Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesPerl Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 10th, 2012, 10:20 AM
1DMF's Avatar
1DMF 1DMF is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2009
Posts: 320 1DMF User rank is Captain (20000 - 30000 Reputation Level)1DMF User rank is Captain (20000 - 30000 Reputation Level)1DMF User rank is Captain (20000 - 30000 Reputation Level)1DMF User rank is Captain (20000 - 30000 Reputation Level)1DMF User rank is Captain (20000 - 30000 Reputation Level)1DMF User rank is Captain (20000 - 30000 Reputation Level)1DMF User rank is Captain (20000 - 30000 Reputation Level)1DMF User rank is Captain (20000 - 30000 Reputation Level)1DMF User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 3 Days 16 h 57 m 54 sec
Reputation Power: 227
Dancer - what am I missing?

OK, I feel like I'm so thick I don't even know how to turn a computer on.

I've looked at RoR, it makes no sense to me! - removed it.

I've installed Dancer, I've created a script with the first demo example
Code:
#!/usr/bin/perl

use Dancer; 

get '/' => sub {return 'Hello World!';}; 

start;


I've uploaded to my CGI-BIN and I've pointed my browser to it, it is supose to output 'Hello World' , all I get is the browser eggtime and do nothing!

What am I missing, why won't the script run?

What's the point of Dancer?

Can someone point me to some literature that explains in single sylable english what a framework is, the point of it , how it works, and why should I bother when I can roll a perl app with my eyes closed, yet can't get the most basic starter script in a framework to say hello?

Thanks,
1DMF.
__________________
Free MP3 Dance Music Downloads

To err is human; To really balls things up you need Microsoft!

Reply With Quote
  #2  
Old October 10th, 2012, 08:52 PM
OmegaZero OmegaZero is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: May 2007
Posts: 737 OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level) 
Time spent in forums: 3 Weeks 5 Days 13 m 32 sec
Reputation Power: 928
Hopefully a someone with Dancer experience will chime in. The following is based on my experience with Catalyst which looks similar after skimming the docs.

I suspect that you're trying to treat Dancer the same a CGI.pm--i.e. stick one script per URL in a public directory and telling your web server to execute it and return the result.

Instead these modules behave more like web servers themselves--you write a script with subroutines to handle each URL and run it as a daemon which will respond to requests. Usually these frameworks have a utility to create a collection of directories and scripts to get you started (in this case, dancer).

You're probably looking at some significant relearning before you things click and you make headway. Most of these frameworks have a big idea at the center and the pieces don't fall into place until you understand the architecture. (Not saying they will, I'm still confused enough on how Catalyst's URL construction works I plan on trying Yesod for my next project)

Dancer::Introduction
Dancer::Deployment
__________________
sub{*{$::{$_}}{CODE}==$_[0]&& print for(%:: )}->(\&Meh);

Reply With Quote
  #3  
Old October 11th, 2012, 07:22 AM
1DMF's Avatar
1DMF 1DMF is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2009
Posts: 320 1DMF User rank is Captain (20000 - 30000 Reputation Level)1DMF User rank is Captain (20000 - 30000 Reputation Level)1DMF User rank is Captain (20000 - 30000 Reputation Level)1DMF User rank is Captain (20000 - 30000 Reputation Level)1DMF User rank is Captain (20000 - 30000 Reputation Level)1DMF User rank is Captain (20000 - 30000 Reputation Level)1DMF User rank is Captain (20000 - 30000 Reputation Level)1DMF User rank is Captain (20000 - 30000 Reputation Level)1DMF User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 3 Days 16 h 57 m 54 sec
Reputation Power: 227
Well I decided to drop Dancer and go with Catalyst.

I read somewhere that Catalyst is the leading industry framework for Perl, and when I checked it out there is a seriously comprehensive tutorial for beginners that even includes a VM image with full testing / 'work with the tutorial' environment.

Within a couple of hours I had my Debian VM running, I downloaded Putty and had an SSH terminal services login, I had the first turtorial example 'Hello' web app running and my browser interacting with the 'Hello' application!

So far so good

Having gone through that process the penny started to drop as to how it worked, and as you say , my mindset was still old school perl, interpreted scripts running on an adhoc basis.

Now I realise that the main app runs all the time listening for HTTP requests such as GET/POST/DELETE etc.. and then they are some how routed to perform the required action.

I know I'm a long way from getting a real app working or even starting to understand the framework, but I've got far further with Catalyst than I did with RoR or Dancer!

I will still have to convert that to how I get it to work on IIS7 via Fast-CGI, whether it runs as a service, how you have multiple apps running (I assume they listen on different port numbers, rather than all on 3000), I need to understand how SSL works if not over 443, and how to fit it all together for MS SQL!

A lot to learn I know, but at least I have a working environment to play with Catalyst, and work through the tutorial and example apps to hopefully learn the framework.

Then I can work out how to configure the IIS7 server to run a Catalyst application.

Do you have any pointers for running on IIS7?

Is this an IIS7 forum question, even though it's about running Perl apps?

You advice is appreciated.

1DMF.

Reply With Quote
  #4  
Old October 11th, 2012, 08:45 AM
OmegaZero OmegaZero is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: May 2007
Posts: 737 OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level) 
Time spent in forums: 3 Weeks 5 Days 13 m 32 sec
Reputation Power: 928
Catalyst has some good docs on their site: Deployment - Catalyst Wiki. The IIS forum or a Catalyst-specific forum would probably be more helpful if you have further questions about IIS.

I'm happy to help if I can, but I reiterate that my experience with Catalyst was with a bizarre setup (Nginx-MongoDB-Catalyst) and the projects ended before I managed to wrap my head around uri_for()'s quirks.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPerl Programming > Dancer - what am I missing?

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap