Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic

Is Monk life right for me?

by mortalhero (Novice)
on Sep 09, 2009 at 04:40 UTC ( #794269=perlquestion: print w/replies, xml ) Need Help??

mortalhero has asked for the wisdom of the Perl Monks concerning the following question:

Like many folks, I've taken the leap and created my own web site. I've decided to help mankind in a new (for me) way. I would like to create a page where a guest could go and enter a few values and using a formula that I developed, get a quick answer. Very simple, right? I used Front Page to develop the site but I found that I cannot use it to do the aforementioned function. I was told I needed to use a script such as that of Perl. I forgot to mention that for the moment I would like to keep my formula a secret. I will share it later if it becomes popular. My question is, is Perl right for me? Do I need to learn it just to do this simple little function? Thanks, Dave

Replies are listed 'Best First'.
Re: Is Monk life right for me?
by GrandFather (Saint) on Sep 09, 2009 at 05:16 UTC

    You don't need to learn Perl to do that. There are many other scripting languages and compiled languages that you could choose instead. However, if you want the best online support provided for any language then the place to get that is PerlMonks and the language of choice is obviously Perl.

    Besides, once you've learned Perl you can then use it to rule the world, or at least manage all those bothersome little tasks around your computer.

    True laziness is hard work
Re: Is Monk life right for me?
by Your Mother (Archbishop) on Sep 09, 2009 at 05:18 UTC

    If your formula is non-trivial and original, patent it. If it's a good enough idea otherwise, get a good NDA together and seek investors.

    Once you have clear ownership of something secrecy is sort of beside the point and some would even argue it a handicap. I wish someone would steal one of my ideas and make a million dollars because then I could sue them for ten million. (Sidebar: I have had to file DCMA notices a couple of times but I doubt anyone made better than coffee money stealing my work.)

    On the Perl front, if you're mathematically/analytically inclined you can write useful Perl code in a week or two with one of the better books to guide you. Perl is one of the hardest languages to master but one of the easiest, if not the easiest, with which to write useful code. You can get plenty of excellent help here if you get stuck on pieces of code.

Re: Is Monk life right for me?
by Utilitarian (Vicar) on Sep 09, 2009 at 05:25 UTC
    The CGI module can take input from a HTML form and display the results of your manipulation of that input.

    If you have no coding experience there is a little bit of work involved in getting it up and running. Something along the lines of the following should work, you'll have to write some of it yourself, but it's for the benefit of humanity so that will be OK I'm sure ;)

    #!/usr/bin/perl -T use strict; use warnings; use CGI::Pretty qw/:standard/; my $result=magicFormula(); print header, <<END_HTML; $result THIS IS WHERE YOUR INITIAL PAGE GOES WITHOUT THE HEAD SECTION ... END_HTML sub magicFormula{ my $_value1=param('value1'); my $value=($_value=~/^\d+(?:.\d+)?/); # make sure our input is nume +ric # repeat for all values you expect from form in the page above my $result=...# PERFORM MAGIC ON INPUT VALUES return "<p> The result of running the magic formula on $value1...$v +aluen is $result</p> <p>Re-enter the values below to check another </p>" if $result; }
Re: Is Monk life right for me?
by JavaFan (Canon) on Sep 09, 2009 at 08:47 UTC
    First decision you need to take is whether you will do the calculation on the server side or on the client side. If it's just a formula that takes only the entered values, there's no need to do the calculation on the server. Just just a little javascript to crank out and display the answer. (You won't be helping mankind by hiding the formula). If you do it on the server side, Perl is one or many languages that can be used. Only use Perl if you feel comfortable with Perl - know that you will be a minority as most programmers don't feel comfortable with Perl. Whether Perl is right for you is something we cannot answer. We don't know you. most programmers don't feel comfortable with Perl.

      Quite right, quite right. We all know most programmers are much more comfortable with Lisp, Logo, Basic, Pascal, and PHP, I mean Befunge. It's Perl that makes the skin crawl.

      ...most programmers don't feel comfortable with Perl. - I wondered how the provenance of the VB-alike, Python 'language' could possibly be explained ;-D

      A user level that continues to overstate my experience :-))

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://794269]
Approved by ELISHEVA
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (4)
As of 2022-05-21 13:37 GMT
Find Nodes?
    Voting Booth?
    Do you prefer to work remotely?

    Results (76 votes). Check out past polls.