Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: getting wrong value

by johngg (Canon)
on Jan 15, 2013 at 22:59 UTC ( [id://1013466]=note: print w/replies, xml ) Need Help??


in reply to getting wrong value

You need sprintf to assign to a scalar. You are getting the value 1 in your $line2 variable as that is what is returned by the successful printf that displays on your screen.

$ perl -E ' > my $line = 55743; > my $line2 = sprintf q{%#x}, $line; > say $line2;' 0xd9bf $

I hope this is helpful.

Cheers,

JohnGG

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (2)
As of 2024-04-24 23:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found