Re: alternative to feature 'signatures'?

2018-02-26 Thread hw
Илья Рассадин writes: > Why can't you use 'signatures' feature at the first place? The perl version I am required to use does not support it. > Usually, it means that you tight yourself to system perl, which is not > a good decision at all. > > Don't trust me on this,

Re: alternative to feature 'signatures'?

2017-12-14 Thread Илья Рассадин
Why can't you use 'signatures' feature at the first place? Usually, it means that you tight yourself to system perl, which is not a good decision at all. Don't trust me on this, trust brian d foy https://www.effectiveperlprogramming.com/2015/11/apple-recommends-installing-your-own-perl/

Re: alternative to feature 'signatures'?

2017-12-14 Thread hw
hw writes: > Gil Magno writes: > >> On 19/11/17 13:57, hw wrote: >>> without being able to use feature 'signatures', how do I verify >>> that parameters passed to a function have been passed to it by >>> the caller? >> >>

Re: alternative to feature 'signatures'?

2017-11-28 Thread hw
Gil Magno writes: > On 19/11/17 13:57, hw wrote: >> without being able to use feature 'signatures', how do I verify >> that parameters passed to a function have been passed to it by >> the caller? > > https://metacpan.org/pod/signatures >

Re: alternative to feature 'signatures'?

2017-11-22 Thread Gil Magno
On 19/11/17 13:57, hw wrote: > without being able to use feature 'signatures', how do I verify > that parameters passed to a function have been passed to it by > the caller? https://metacpan.org/pod/signatures https://metacpan.org/pod/signatures#SEE-ALSO https://metacpan.org/pod/Sub::Signatures

Re: alternative to feature 'signatures'?

2017-11-22 Thread hw
Chas. Owens wrote: What no one has said so far is the importance of using Carp when throwing errors related to how the function was called. The Carp module provides versions of warn (carp) and die (croak) that give the line and file where the call to the function occurred rather than the

Re: alternative to feature 'signatures'?

2017-11-22 Thread hw
Gil Magno wrote: On 19/11/17 13:57, hw wrote: without being able to use feature 'signatures', how do I verify that parameters passed to a function have been passed to it by the caller? If you're dealing with positional parameters[1] (and not with named ones) you can check for the size of @_

Re: alternative to feature 'signatures'?

2017-11-22 Thread hw
Andrew Solomon wrote: This is how I'd go about it: https://gist.github.com/andrewsolomon/323a2b317ea5903f662fbaaded254798 "exists" is true if there's a key in a hash even if the key's value is undef. Does that provide a solution for you, or are there other constraints? That would require to

Re: alternative to feature 'signatures'?

2017-11-19 Thread Chas. Owens
What no one has said so far is the importance of using Carp when throwing errors related to how the function was called. The Carp module provides versions of warn (carp) and die (croak) that give the line and file where the call to the function occurred rather than the line of the carp or croak:

Re: alternative to feature 'signatures'?

2017-11-19 Thread Gil Magno
On 19/11/17 13:57, hw wrote: > without being able to use feature 'signatures', how do I verify > that parameters passed to a function have been passed to it by > the caller? If you're dealing with positional parameters[1] (and not with named ones) you can check for the size of @_ inside your

Re: alternative to feature 'signatures'?

2017-11-19 Thread Gil Magno
On 19/11/17 15:40, Gil Magno wrote: > $num_of_params = scalar @_; Complementing... In order to get the number of params, you could do $num_of_params = @_; without using "scalar @_", because this assignment is already in scalar context. But if you're in list context, you have to use

Re: alternative to feature 'signatures'?

2017-11-19 Thread Andrew Solomon
This is how I'd go about it: https://gist.github.com/andrewsolomon/323a2b317ea5903f662fbaaded254798 "exists" is true if there's a key in a hash even if the key's value is undef. Does that provide a solution for you, or are there other constraints? On Sun, Nov 19, 2017 at 4:57 PM, hw

alternative to feature 'signatures'?

2017-11-19 Thread hw
Hi, without being able to use feature 'signatures', how do I verify that parameters passed to a function have been passed to it by the caller? A test for undef is not sufficient because the value passed to a function may be undef itself, and I need to be able to distinguish between the