in reply to lazily getting around an Exporter problem

I haven't tested it, but I suspect that making a change like this might help:

        Contextual::Return::LIST( sub { qw/Larry Curly Moe/ } )

If you're not getting the imports, you're not getting their prototypes and you have to be slightly more explicit.

Replies are listed 'Best First'.
Re^2: lazily getting around an Exporter problem
by meraxes (Friar) on Oct 04, 2007 at 21:37 UTC

    That actually does properly return qw/Larry Curly Moe/ if called in a LIST context but it doesn't permit me to have more than one return context.

    • If I add another one, Contextual::Return::SCALAR( sub{ 3 }), I get a syntax error.
    • If I || those two conditions on the same line (thinking if the first fails, I'll get the SCALAR context), I get told that "main::funner() cannot be called in boolean context".
    • If I call funner() in a scalar context when I just have only have the LIST contextual return clause i get this out of Data::Dumper:
    $VAR1 = { 'result' => bless( do{\(my $o = undef)}, 'Contextual::Return +::Value' ) };

    So it seems you're closer... but it's still a breakin'.

    --
    meraxes