Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

Re: How can I re-program the exists function?

by tobyink (Abbot)
on Aug 24, 2012 at 15:35 UTC ( #989572=note: print w/replies, xml ) Need Help??

in reply to How can I re-program the exists function?

I think the closest you could get would be to create your my_exists function taking a separate hashref and string as you already have, then use something like Devel::Declare or Devel::CallParser (perhaps coupled with PPI) to hook into the Perl compiler and translate this:


to this during the parse/compile stage:

my_exists(\%{hash}, 'key')

It's not an easy task though.

perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'

Replies are listed 'Best First'.
Re^2: How can I re-program the exists function?
by Anonymous Monk on Aug 24, 2012 at 16:25 UTC

    t's not an easy task though.

    See Method::Signatures , it looks easy enough to copy that :)

Re^2: How can I re-program the exists function?
by greengaroo (Hermit) on Aug 27, 2012 at 15:40 UTC

    Thanks, but I don't think it's worth it. It is not that important since I managed to make it work.

    There are no stupid questions, but there are a lot of inquisitive idiots.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://989572]
LanX (measures/mass)
[Tanktalus]: choroba: thanks, not sure why it wasn't doing that for me, but will try to figure it out. :)
[LanX]: can I copy a authotification cookie from mozilla and reuse it in LWP::Useragent?
[LanX]: nevermind
Tanktalus is at work, ssh'd home, using his cbstats bridge to talk on perlmonks CB. :)
[Tanktalus]: anyway, next is to figure out how to get postgres to agree that these are the same :)

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (15)
As of 2018-03-21 15:53 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (269 votes). Check out past polls.