P is for Practical | |
PerlMonks |
Style - how to give class method call as parameterby strat (Canon) |
on Jun 26, 2012 at 13:13 UTC ( [id://978412]=perlquestion: print w/replies, xml ) | Need Help?? |
strat has asked for the wisdom of the Perl Monks concerning the following question: Dear Monks, I come here with a simple problem: I need to add a timeout to a method call, and now think about the best way how to 'say' it. Well, I don't want to use named parameters for such a simple task. Here the original call without timeout:
Well, I wrote a little sub which deals with the timeout, and called it like the following: Number 1:
The => looks a little bit like the -> from the original call, but there are no pairs. Number 2:
But there you don't see what belongs together... Number 3:
But the longer I look at those ways, the less I like them... Please, could you help me and tell me how you would write it?
Best regards,
Back to
Seekers of Perl Wisdom
|
|