develooper Front page | perl.perl5.porters | Postings from April 2006

Re: A user pragma example

Thread Previous | Thread Next
From:
David Nicol
Date:
April 3, 2006 08:51
Subject:
Re: A user pragma example
Message ID:
934f64a20604030851w3364b95exbcc51f98b83cee44@mail.gmail.com
On 4/1/06, Nicholas Clark <nick@ccl4.org> wrote:

> No. It's going to need the games with caller, rather than accessing %^H,
> simply because the information it needs to get is stored in the very structure
> that caller already reads.
>
> Nicholas Clark

would

    sub HINTS(){(caller(1))[10]};

allow further code in the module to refer to

   HINTS->{myhint}

also,

would

    sub MYHINT(){(caller(1))[10]->{myhint}};

allow further code in the module to refer to

   MYHINT

--
David L Nicol
"the opportunity of making good with a hard undertaking - one that had
been held impossible of realization - would be a strong asset to the
firm's reputation" -- William Russell, 1860
http://cronos.advenge.com/pc/americana/PonyExpress/p15.html

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About