Help for this page

Select Code to Download


  1. or download this
    sub foo {
       my ($foo) = @_;
       print($foo->{bar}, "\n");
    }
    
  2. or download this
    sub foo {
       my %foo = @_;
       print($foo{bar}, "\n");
    }
    
  3. or download this
    HV* hv = newHV();
    SV* rv = newRV_noinc(hv);  /* noinc to abandon our ref to the HV */
    ...
    XPUSHs(sv_2mortal(rv));   /* Mortalize to abandon our ref to the RV */
    
    ...