Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
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 making s'mores by the fire in the courtyard of the Monastery: (9)
As of 2015-09-01 09:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The oldest computer book still on my shelves (or on my digital media) is ...













    Results (369 votes), past polls