Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

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

--
meraxes

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://642775]
help
Chatterbox?
[moritz]: seems there's a size limit for hostenum, and the error message just sucks
[vrk]: None, other than the location of the error: auto/NetAddr/IP/ _splitref.al
[vrk]: Aha, there's a reference to "bug report 82719" in NetAddr/IP.pm's sub _splitref.
[moritz]: wow, that's their idea of an "improved error message"
[moritz]: how about "This network is too large to enumerate all host addresses." or so?
[vrk]: Well, there's a call to notcontiguous() before the error, whose description is "counts the bit positions remaining in the mask when the rightmost '0's are removed"
[vrk]: Clear as mud!

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (9)
As of 2017-04-25 07:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (449 votes). Check out past polls.