Re: CGI.PM and hidden()



On 04/13/2008 12:12 PM, dtshedd@xxxxxxxxx wrote:
[...]
print hidden(-name=>"page", -value=>$page);

problem is that the new line does not print the correct value of $page
(its supposed to change every pass through the perl code), [...]

You should create a small (but complete) script that demonstrates the problem you're having. For example, see this program:

#!/usr/bin/perl
use strict;
use warnings;
use CGI qw/:standard/;
use File::Slurp;

my $counter = '/tmp/ses/count';
-f $counter || write_file($counter, '0');
my $page = read_file($counter) + 1;
write_file($counter, $page);

print header('text/plain');
print hidden(-name=>"page", -value=>$page);


.



Relevant Pages

  • Re: A script to flag commonly misused words
    ... is preferable in general as it allows you to scope warnings. ... use strict; ... I first wrote a script to extract the words to flag from your ... I discovered that at least one of the expressions you ...
    (comp.lang.perl.misc)
  • Re: [PATCH] Speed up "make headers_*"
    ... 'use strict' and 'use warnings' is recommended. ... The parentheses are not needed for most of the built-in functions. ... More or less the same comments would apply to the next script as well. ...
    (Linux-Kernel)
  • Re: Regular Expression and file editing.
    ... Goksie wrote: ... If i run the script, the changes could not be effected bcos the files is ... use warnings; ... use strict; ...
    (perl.beginners)
  • Re: Counting column delimiters per row in a text file
    ... Then parse (see the parse method) ... This can't be more than 20 lines or so including use strict and use ... Put the data in the __DATA__ section of your script. ... use warnings; ...
    (comp.lang.perl.misc)
  • Re: Passing vars to a "require"d script
    ... > require'd script didn't seem to pull in the form data, ... >> use strict; ... >> use warnings; # main program ...
    (comp.lang.perl.misc)