Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid

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]
[Corion]: Discipulus: Yeah - but when writing Perl to save time (instead of having fun), it helps to look whether you're actually saving time ;) Why spend 5 minutes doing manually what you can spend three years automating? ;)
[Corion]: choroba: Oh, yeah :-D

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (6)
As of 2017-07-27 09:34 GMT
Find Nodes?
    Voting Booth?
    I came, I saw, I ...

    Results (408 votes). Check out past polls.