Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

Re: Re: Re: Re: Re: dilemma

by Courage (Parson)
on Aug 09, 2003 at 19:28 UTC ( #282458=note: print w/ replies, xml ) Need Help??

in reply to Re: Re: Re: Re: dilemma
in thread dilemma

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

Comment on Re: Re: Re: Re: Re: dilemma
Download Code

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://282458]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (3)
As of 2015-11-28 04:42 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (737 votes), past polls