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. :)
In reply to Re^4: Perl 6: Static/Dynamic Strong/Weak Type Systems
by rcaputo
in thread Perl 6: Static/Dynamic Strong/Weak Type Systems
by tomazos
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |