Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

You should be able to replace the use of goto in the four subroutines private(), property(), public() & readonly() with a normal function call if you postpend the caller() to @_, and the only difference will be that it will run (marginally) faster. That is, property() would become:

sub property($\%;$) { ## no critic -- prototype &_check_property; push @_, scalar caller(); &_install_property; }

and _install_property() would become:

sub _install_property{ my ($label, $hash, $opt, $caller) = @_; # my $caller = caller(0); # we get here via "goto", so caller(0) is + right $PROP_DATA_FOR{ $caller }{$label} = $hash; my $options = _merge_options( $caller, $opt ); if ( exists $options->{privacy} && $options->{privacy} eq 'public' + ) { no strict 'refs'; *{ "$caller\::$label" } = ($options->{set_hook} || $options->{get_hook}) ? _gen_hook_accessor( $hash, $label, $options->{get_ho +ok}, $options->{set_hook} +) : _gen_accessor( $hash ) ; $PUBLIC_PROPS_FOR{ $caller }{ $label } = 1; } return; }

That's untested, but I believe it shoudl work and be a little quicker. That only leaves the goto at line 81 (There is no goto at line: 666? Maybe the "evil" connotations made you miss that the line number 666 related to dprof_pp rather than the source file :).

This might be more awkward as Exporter might rely upon caller() being different, though I've never seen anyone else that subclasses Exporter use goto. I think you should try just deleting the goto on line 81 and see what happens.

Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

In reply to Re: Class::InsideOut doesn't play nicely with DProf by BrowserUk
in thread Class::InsideOut doesn't play nicely with DProf by patspam

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, 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, 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.
  • Log In?

    What's my password?
    Create A New User
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others rifling through the Monastery: (4)
    As of 2021-04-14 04:34 GMT
    Find Nodes?
      Voting Booth?

      No recent polls found