For sure we were talking apples and oranges.

Initially I thought that you can not use *XS* feature in perl-5.6.1 that was appeared in perl-5.8.0.

Now I see that in perl-5.6.1 there is no way at all to prototype a subroutine that takes a reference to array or hash as its first argument. I checked sources and realized that.

In this case may be source filters could be kind of solution as a hack. But source filter not necessarily installed everywhere.

May be it's better to introduce three prototyped functions for each: share_a, share_s, share_h (for sharing array, scalar and hash respectively)?

Also I did some RTFSing (f=fine here), and now understand a little bit more on situation. Following code is a maximum that I reached on this matter, it finds a prototype for a subroutine:

use B; sub share(\[@%$]) {print qq/[@_]/} %stash = B::svref_2object(\%{"::"})->ARRAY; $c=B::svref_2object(\&share); #... or this $c=B::svref_2object(\&share); print 'prototype equals to '. $stash{share}->CV->PV,"\n";

Courage, the Cowardly Dog


In reply to Re: Re: Re: Re: Re: Forks.pm dilemma by Courage
in thread Forks.pm dilemma by liz

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.