Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Any idea to let Perl form data and scalar work in same page?

by mithaldu (Monk)
on Mar 19, 2013 at 14:23 UTC ( #1024307=note: print w/ replies, xml ) Need Help??


in reply to Any idea to let Perl form data and scalar work in same page?

Looking at your code, trying to fix that as it is would benefit neither you nor us. Please head over to the Perl Tutorial Hub and choose a current resource to start learning from. I can personally recommend Modern Perl 2012 and Ovid's Beginning Perl (which has a nice chapter on web apps).

Especially the latter is recommended because CGI.pm is a module that is very old and will make development very difficult for you (as you are noticing). Better solutions described in that book will make it much easier to write web applications.

As a matter of curiosity, could you please also tell us what resource you are currently learning from and how you found it?


Comment on Re: Any idea to let Perl form data and scalar work in same page?
Re^2: Any idea to let Perl form data and scalar work in same page?
by Anonymous Monk on Mar 19, 2013 at 14:29 UTC

    Especially the latter is recommended because CGI.pm is a module is very old and will make development very difficult for you (as you are noticing).

    His current issues have very little to do with CGI.pm being old

      Well, kinda. The OP's problem is that CGI.pm is exhausting STDIN, and it's impossible to seek back to the start of STDIN.

      The modern interface for Perl web apps is PSGI (implemented by Plack). The equivalent of reading from STDIN in PSGI is to read from $env->{"psgi.input"}. This is a filehandle that is usually seekable (depending on what handler you're using).

      package Cow { use Moo; has name => (is => 'lazy', default => sub { 'Mooington' }) } say Cow->new->name

        Well, kinda...

        And I thought the problem was not using param() for everything

Re^2: Any idea to let Perl form data and scalar work in same page?
by GordonLim (Acolyte) on Mar 19, 2013 at 16:01 UTC
    I copied this from my senior. Because I cannot find the method how to from loop grep the row of the data I need (data is from another .txt file). Previous page list out the data.txt file data with table, and click the "edit" button to grep the row I want to edit. This page is for filter and edit the data row I want. Sorry that I still very new to develop website.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1024307]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (12)
As of 2014-09-18 11:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (112 votes), past polls