Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Re: How do i refresh a page from the perl script.

by epoptai (Curate)
on Jul 02, 2001 at 23:14 UTC ( #93286=note: print w/replies, xml ) Need Help??


in reply to Re: How do i refresh a page from the perl script.
in thread How do i refresh a page from the perl script.

With -w enabled you can't use params like that without getting uninitialized value warnings when the params aren't defined. Also $q->param{'Address'} shouldn't have curly braces but parentheses: $q->param('Address').

This version shows a way to properly initialize the variables whether the params exist or not.

#!/usr/local/bin/perl -w use strict; use CGI; my $q = CGI::new(); my $name = $q->param('Name') || ''; my $addy = $q->param('Address') || ''; print $q->header; print <<HTML; <form> Name: <input type="text" name="Name" value="$name"> Address: <input type="text" name="Address" value="$addy"> <input type="submit" value="Refresh"> </form> HTML

--
Check out my Perlmonks Related Scripts like framechat, reputer, and xNN.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://93286]
help
Chatterbox?
[stevieb]: interestingly enough, someone else got my Devel::Examine:: Subs distribution for their PRC, and I applaud the change. This dist is extremely complicated and mostly obfu, but the person doing it understood PPI enough to change...
[stevieb]: ...something I had overlooked in the extreme depths of the core functionality. After merging, then a couple of extra tweaks, I still have 100% test coverage. Yay for people who write tests!

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (5)
As of 2017-01-24 01:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you watch meteor showers?




    Results (199 votes). Check out past polls.