Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

(jjhorner)Printing BigInts

by jjhorner (Hermit)
on Jul 12, 2000 at 18:49 UTC ( [id://22204]=note: print w/replies, xml ) Need Help??


in reply to Printing BigInts

Perhaps this code will help:

#!/usr/bin/perl -w # ic_cookies - sample CGI script that uses a cookie use CGI qw(:standard); use strict; my $cookname = "favorite ice cream"; my $favorite = param("flavor"); my $tasty = cookie($cookname) || 'mint'; unless ($favorite) { print header(), start_html("Ice Cookies"), h1("Hello Ice Cream"), hr(), start_form(), p("Please select a flavor: ", textfield("flavor",$tasty)), end_form(), hr(); exit; } my $cookie = cookie( -NAME => $cookname, -VALUE => $favorite, -EXPIRES => "+2y", ); print header(-COOKIE => $cookie), start_html("Ice Cookies, #2"), h1("Hello Ice Cream"), p("You chose as your favorite flavor `$favorite'.");

This comes from Recipe 19.10 in the Perl Cookbook.

Discussion

The cookie was prepared with:

my $cookie = cookie( -NAME => $cookname, -VALUE => $favorite, -EXPIRES => "+2y", );

And the cookie was set with:

print header(-COOKIE => $cookie), start_html("Ice Cookies, #2"), h1("Hello Ice Cream"), p("You chose as your favorite flavor `$favorite'.");

I hope this helps.

UPDATE: Oh Boy! I missed the boat on this one. Please ignore this message!!

J. J. Horner
Linux, Perl, Apache, Stronghold, Unix
jhorner@knoxlug.org http://www.knoxlug.org/

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (7)
As of 2024-04-18 10:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found