Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Pure Perl Internals (with Pure Perl Segfaults)

by Ovid (Cardinal)
on Mar 11, 2004 at 22:06 UTC ( #335993=perlmeditation: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use Pointer;
    my $x   = "Hello, world";
    my $sv  = pointer->of_scalar($x);
    ...
    # or
    
    print pointer->of_scalar("Hello, world")->get_pointer->get_pointer->ge
    +t_string;
    
  2. or download this
    my $x   = "Hello, world";
    $x      = 42;
    my $sv  = pointer->of_scalar($x);
    my $svpv = $sv->get_pointer;
    my $pointer_to_string = $svpv->get_pointer;
    print $pointer_to_string->get_string;
    
  3. or download this
    $ perl -MPointer -le 'print pointer->of_scalar(42)->get_pointer->get_p
    +ointer->get_string;'
    Segmentation fault
    
  4. or download this
    perl -MPointer -MPointer::int -le 'print ((pointer->of_scalar(42)->get
    +_pointer("int") + 3)->get)'
    42
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlmeditation [id://335993]
Approved by rob_au
Front-paged by kvale
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2016-10-01 22:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?






    Results (9 votes). Check out past polls.