Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Printing BigInts

by ahunter (Monk)
on Jul 12, 2000 at 18:56 UTC ( [id://22205]=note: print w/replies, xml ) Need Help??


in reply to Printing BigInts

Math::BigInt returns references to blessed scalars, and uses overload to cause it to be stringified when you refer to it in a string. You put the reference directly into the argument block used by CGI::Cookie, and CGI::Cookie doesn't know what to do with it. Simple solution: force it to be stringified:
$c = new CGI::Cookie(-name => 'NetAppliance1.0', -value => "$id", -path => '/cgi-bin/' -secure => 0 );
Data::Dumper is often your friend in these circumstances:
use Data::Dumper; print Dumper({-value => $id});
produces:
$VAR1 = { '-value' => bless(do {\(my $o= '+123456789123456789')}, 'Mat +h::BigInt') };
Which is a good indication that things are not as you thought :-)

Andrew. (You should really be using CGI.pm throughout)

Replies are listed 'Best First'.
RE: Re: Printing BigInts
by Anonymous Monk on Jul 12, 2000 at 21:17 UTC
    what do you mean by CGI.pm throughout? I did this :
    use CGI qw/:standard/; use CGI::Cookie;
      I think he means: print header(-cookie => $c); instead of your two print lines. Let CGI.pm take care of the gory details for you!

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (7)
As of 2024-03-28 19:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found