Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^4: Perl 6: Static/Dynamic Strong/Weak Type Systems

by rcaputo (Chaplain)
on Apr 16, 2006 at 18:26 UTC ( [id://543675]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Perl 6: Static/Dynamic Strong/Weak Type Systems
in thread Perl 6: Static/Dynamic Strong/Weak Type Systems

Demo? I've had this code lying around for ages:

#!/usr/bin/perl -wl use strict; my $target = 'IHBT'; print "target contains : $target"; my $target_address = \$target + 0; # nummify my $native_version = pack 'L', $target_address; my $pointer = pack 'P', $native_version; print "target address : ", sprintf('%x', $target_address); my $sv = unpack('P4', $native_version); print "deref'd packed (sv) : ", sprintf('%x', unpack('L', $sv)); my $pv = unpack('P4', $sv); print "deref'd sv (pv) : ", sprintf('%x', unpack('L', $pv)); my $value = unpack('P' . length($target), $pv); print "deref'd pv (value) : ``$value''\n";

I hope it helps. :)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2024-04-19 04:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found