Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
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 all is quiet...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (8)
As of 2017-03-26 16:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (315 votes). Check out past polls.