Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

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

by tobyink (Abbot)
on Mar 19, 2013 at 14:57 UTC ( #1024318=note: print w/ replies, xml ) Need Help??


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

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


Comment on Re^3: Any idea to let Perl form data and scalar work in same page?
Download Code
Re^4: Any idea to let Perl form data and scalar work in same page?
by Anonymous Monk on Mar 19, 2013 at 16:04 UTC

    Well, kinda...

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

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (10)
As of 2014-09-22 06:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

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











    Results (182 votes), past polls