Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
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 drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2016-12-10 02:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (159 votes). Check out past polls.