Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^2: Hope a subroutine will return undef by default

by qj1020 (Initiate)
on Feb 11, 2014 at 17:23 UTC ( #1074457=note: print w/replies, xml ) Need Help??


in reply to Re: Hope a subroutine will return undef by default
in thread Hope a subroutine will return undef by default

Thanks to you all for replying and giving me some thoughts. Will check out the link of the youtube video when I get more time.

Here is more of the context: the subroutines (in the form of strings) was sent to my server on the fly for execution by a function under my control. I wish I can go and change the source of the subroutines to add an explicit "return undef" (the function is executed on my side in scalar context, so it's ok) but I can't. I am thinking of modifying the incoming subroutines, if it doesn't have a "return undef" before the ending of the subroutine, I will add one. But it's not elegant.

  • Comment on Re^2: Hope a subroutine will return undef by default

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1074457]
help
Chatterbox?
[shmem]: hmm.. which makes emerge the question: is there a way to attach a subroutine to a variable, which is run as soon as that variable changes?
[moritz]: through a tie?
[shmem]: moritz: of course!
shmem slaps forehead m(
[shmem]: consider, then, @CBMonks as a tied variable which triggers withdrawing empty cups and serving new ones
[GotToBTru]: it's always teatime somewhere

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (9)
As of 2017-04-24 12:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (439 votes). Check out past polls.