Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
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 studying the Monastery: (17)
As of 2014-08-27 19:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (250 votes), past polls