in reply to Re: Silencing specific warnings when executing coderef?
in thread Silencing specific warnings when executing coderef?

Are Pluggable Keywords and Parse::Keyword related?

FWIW I found a pretty simple way to detect if someone tries to use a return statement within a loop and to warn the author. Parsing the Op-tree with B::Concise shows explicit return ops.

BUT the concept is flawed cause loops can't be nested since @list is shared by all instances.¹ :(

Cheers Rolf

( addicted to the Perl Programming Language)

update

¹) Think I found an easy way to solve this by accessing the input-array via the caller(1)! :)

  • Comment on Re^2: Silencing specific warnings when executing coderef?

Replies are listed 'Best First'.
Re^3: Silencing specific warnings when executing coderef?
by tobyink (Canon) on Mar 24, 2014 at 12:50 UTC

    Parse::Keyword is a Perl interface to the XS pluggable keyword API.

    Here's how I look for return and wantarray in Sub::Block (a module which might, by the way be useful for your purposes).

    use Moops; class Cow :rw { has name => (default => 'Ermintrude') }; say Cow->new->name