Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

Re: Printing BigInts

by ahunter (Monk)
on Jul 12, 2000 at 18:56 UTC ( #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});
$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 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 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 take care of the gory details for you!

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://22205]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (3)
As of 2017-08-22 06:31 GMT
Find Nodes?
    Voting Booth?
    Who is your favorite scientist and why?

    Results (329 votes). Check out past polls.