Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

Re^2: Cancel/no-op a require

by sedusedan (Monk)
on Dec 07, 2012 at 13:44 UTC ( #1007739=note: print w/ replies, xml ) Need Help??

in reply to Re: Cancel/no-op a require
in thread Cancel/no-op a require

Ah, so this particular sentence in perlfunc is the one that gets me confused: The subroutine should return either nothing or else a list of up to three values in the following order.

So instead of returning (undef, sub{...}) I should've just returned (sub {...}).

Thanks, Toby.

Comment on Re^2: Cancel/no-op a require
Re^3: Cancel/no-op a require
by tobyink (Abbot) on Dec 07, 2012 at 14:07 UTC

    Also the innards of the function are kinda odd. You need to assign lines to $_ rather than returning them. I can understand why they did it that way, but it's pretty strange.

    perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1007739]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (13)
As of 2014-12-22 15:56 GMT
Find Nodes?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?

    Results (121 votes), past polls