Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

Re^2: lazily getting around an Exporter problem

by meraxes (Friar)
on Oct 04, 2007 at 21:37 UTC ( #642775=note: print w/replies, xml ) Need Help??

in reply to Re: lazily getting around an Exporter problem
in thread lazily getting around an Exporter problem

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'.


Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://642775]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (3)
As of 2017-12-17 09:15 GMT
Find Nodes?
    Voting Booth?
    What programming language do you hate the most?

    Results (462 votes). Check out past polls.